Skip to content

Commit 82aa32a

Browse files
authored
Merge branch 'main' into report-artifacts-size
2 parents 50c01a6 + ba8075f commit 82aa32a

File tree

100 files changed

+1783
-348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1783
-348
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ This project follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) fo
88

99
## [Unreleased]
1010

11+
## [1.16.0] - 2023-06-29
12+
13+
14+
### Added
15+
* Feature: Add AppConfig provider to parameters module (#1104) by @scottgerring
16+
17+
### Maintenance
18+
* Fix: missing idempotency key should not persist any data (#1201) by @jeromevdl
19+
* Fix:Removing env var credentials provider as default. (#1161) by @msailes
20+
* Chore: Swap implementation of `aspectj-maven-plugin` to support Java 17 (#1172) by @mriccia
21+
* Test: end-to-end tests for core modules and idempotency (#970) by @jeromevdl
22+
* Chore: cleanup spotbugs maven profiles (#1236) by @jeromevdl
23+
* Chore: removing logback from all components (#1227) by @jeromevdl
24+
* Chore: Roll SLF4J log4j bindings to v2 (#1190) by @scottgerring
25+
* Deps: Bump third party dependencies to the latest versions.
26+
27+
1128
## [1.15.0] - 2023-03-20
1229

1330
### Added

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ Powertools for AWS Lambda (Java) is available in Maven Central. You can use your
2020
<dependency>
2121
<groupId>software.amazon.lambda</groupId>
2222
<artifactId>powertools-tracing</artifactId>
23-
<version>1.15.0</version>
23+
<version>1.17.0-SNAPSHOT</version>
2424
</dependency>
2525
<dependency>
2626
<groupId>software.amazon.lambda</groupId>
2727
<artifactId>powertools-logging</artifactId>
28-
<version>1.15.0</version>
28+
<version>1.17.0-SNAPSHOT</version>
2929
</dependency>
3030
<dependency>
3131
<groupId>software.amazon.lambda</groupId>
3232
<artifactId>powertools-metrics</artifactId>
33-
<version>1.15.0</version>
33+
<version>1.17.0-SNAPSHOT</version>
3434
</dependency>
3535
...
3636
</dependencies>

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>software.amazon.lambda</groupId>
88
<artifactId>powertools-examples</artifactId>
9-
<version>1.15.0</version>
9+
<version>1.17.0-SNAPSHOT</version>
1010
<packaging>pom</packaging>
1111

1212
<name>Powertools for AWS Lambda (Java) library Examples</name>

examples/powertools-examples-core/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44

55
<groupId>software.amazon.lambda.examples</groupId>
6-
<version>1.15.0</version>
6+
<version>1.17.0-SNAPSHOT</version>
77
<artifactId>powertools-examples-core</artifactId>
88
<packaging>jar</packaging>
99

@@ -13,6 +13,7 @@
1313
<log4j.version>2.20.0</log4j.version>
1414
<maven.compiler.source>1.8</maven.compiler.source>
1515
<maven.compiler.target>1.8</maven.compiler.target>
16+
<maven.deploy.skip>true</maven.deploy.skip>
1617
</properties>
1718

1819
<dependencies>

examples/powertools-examples-idempotency/pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
<modelVersion>4.0.0</modelVersion>
44

55
<groupId>software.amazon.lambda.examples</groupId>
6-
<version>1.15.0</version>
6+
<version>1.17.0-SNAPSHOT</version>
77
<artifactId>powertools-examples-idempotency</artifactId>
88
<packaging>jar</packaging>
99
<name>Powertools for AWS Lambda (Java) library Examples - Idempotency</name>
1010

1111
<properties>
1212
<log4j.version>2.20.0</log4j.version>
1313
<maven.compiler.source>1.8</maven.compiler.source>
14-
<maven.compiler.target>1.8</maven.compiler.target>
14+
<maven.compiler.target>1.8</maven.compiler.target>
15+
<maven.deploy.skip>true</maven.deploy.skip>
1516
</properties>
1617

1718
<dependencies>

examples/powertools-examples-parameters/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>software.amazon.lambda.examples</groupId>
5-
<version>1.15.0</version>
5+
<version>1.17.0-SNAPSHOT</version>
66
<artifactId>powertools-examples-parameters</artifactId>
77
<packaging>jar</packaging>
88
<name>Powertools for AWS Lambda (Java) library Examples - Parameters</name>
99

1010
<properties>
1111
<maven.compiler.source>1.8</maven.compiler.source>
1212
<maven.compiler.target>1.8</maven.compiler.target>
13+
<maven.deploy.skip>true</maven.deploy.skip>
1314
</properties>
1415

1516
<dependencies>

examples/powertools-examples-serialization/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>software.amazon.lambda.examples</groupId>
5-
<version>1.15.0</version>
5+
<version>1.17.0-SNAPSHOT</version>
66
<artifactId>powertools-examples-serialization</artifactId>
77
<packaging>jar</packaging>
88
<name>Powertools for AWS Lambda (Java) library Examples - Serialization</name>
99

1010
<properties>
1111
<maven.compiler.source>1.8</maven.compiler.source>
1212
<maven.compiler.target>1.8</maven.compiler.target>
13+
<maven.deploy.skip>true</maven.deploy.skip>
1314
</properties>
1415

1516
<dependencies>

examples/powertools-examples-sqs/pom.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>software.amazon.lambda.examples</groupId>
5-
<version>1.15.0</version>
5+
<version>1.17.0-SNAPSHOT</version>
66
<artifactId>powertools-examples-sqs</artifactId>
77
<packaging>jar</packaging>
88
<name>Powertools for AWS Lambda (Java) library Examples - SQS</name>
99

1010
<properties>
1111
<log4j.version>2.20.0</log4j.version>
1212
<maven.compiler.source>1.8</maven.compiler.source>
13-
<maven.compiler.target>1.8</maven.compiler.target>
13+
<maven.compiler.target>1.8</maven.compiler.target>
14+
<maven.deploy.skip>true</maven.deploy.skip>
1415
</properties>
1516

1617
<dependencies>
@@ -27,7 +28,7 @@
2728
<dependency>
2829
<groupId>software.amazon.awssdk</groupId>
2930
<artifactId>url-connection-client</artifactId>
30-
<version>2.20.93</version>
31+
<version>2.20.102</version>
3132
</dependency>
3233
<dependency>
3334
<groupId>com.amazonaws</groupId>

examples/powertools-examples-validation/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>software.amazon.lambda.examples</groupId>
5-
<version>1.15.0</version>
5+
<version>1.17.0-SNAPSHOT</version>
66
<artifactId>powertools-examples-validation</artifactId>
77
<packaging>jar</packaging>
88
<name>Powertools for AWS Lambda (Java) library Examples - Validation</name>
99

1010
<properties>
1111
<maven.compiler.source>1.8</maven.compiler.source>
1212
<maven.compiler.target>1.8</maven.compiler.target>
13+
<maven.deploy.skip>true</maven.deploy.skip>
1314
</properties>
1415

1516
<dependencies>

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ extra_javascript:
8383

8484
extra:
8585
powertools:
86-
version: 1.15.0
86+
version: 1.17.0-SNAPSHOT
8787

8888
repo_url: https://github.com/aws-powertools/powertools-lambda-java
8989
edit_uri: edit/main/docs

pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>software.amazon.lambda</groupId>
88
<artifactId>powertools-parent</artifactId>
9-
<version>1.15.0</version>
9+
<version>1.17.0-SNAPSHOT</version>
1010
<packaging>pom</packaging>
1111

1212
<name>Powertools for AWS Lambda (Java) library Parent</name>
@@ -60,7 +60,7 @@
6060
<log4j.version>2.20.0</log4j.version>
6161
<jackson.version>2.15.2</jackson.version>
6262
<aspectj.version>1.9.7</aspectj.version>
63-
<aws.sdk.version>2.20.93</aws.sdk.version>
63+
<aws.sdk.version>2.20.102</aws.sdk.version>
6464
<aws.xray.recorder.version>2.14.0</aws.xray.recorder.version>
6565
<payloadoffloading-common.version>2.1.3</payloadoffloading-common.version>
6666
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -524,6 +524,7 @@
524524
<version>3.1.2</version>
525525
<configuration>
526526
<argLine>
527+
@{argLine}
527528
--add-opens java.base/java.util=ALL-UNNAMED
528529
--add-opens java.base/java.lang=ALL-UNNAMED
529530
</argLine>

powertools-cloudformation/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<artifactId>powertools-parent</artifactId>
1212
<groupId>software.amazon.lambda</groupId>
13-
<version>1.15.0</version>
13+
<version>1.17.0-SNAPSHOT</version>
1414
</parent>
1515

1616
<name>Powertools for AWS Lambda (Java)library Cloudformation</name>

powertools-core/pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<parent>
1111
<artifactId>powertools-parent</artifactId>
1212
<groupId>software.amazon.lambda</groupId>
13-
<version>1.15.0</version>
13+
<version>1.17.0-SNAPSHOT</version>
1414
</parent>
1515

1616
<name>Powertools for AWS Lambda (Java) library Core</name>
@@ -82,6 +82,11 @@
8282
<artifactId>assertj-core</artifactId>
8383
<scope>test</scope>
8484
</dependency>
85+
<dependency>
86+
<groupId>org.mockito</groupId>
87+
<artifactId>mockito-inline</artifactId>
88+
<scope>test</scope>
89+
</dependency>
8590
</dependencies>
8691

8792
</project>

powertools-core/src/main/java/software/amazon/lambda/powertools/core/internal/LambdaConstants.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@ public class LambdaConstants {
1818
public static final String AWS_REGION_ENV = "AWS_REGION";
1919
public static final String AWS_LAMBDA_INITIALIZATION_TYPE = "AWS_LAMBDA_INITIALIZATION_TYPE";
2020
public static final String ON_DEMAND = "on-demand";
21+
public static final String X_AMZN_TRACE_ID = "_X_AMZN_TRACE_ID";
22+
public static final String AWS_SAM_LOCAL = "AWS_SAM_LOCAL";
23+
public static final String ROOT_EQUALS = "Root=";
24+
public static final String POWERTOOLS_SERVICE_NAME = "POWERTOOLS_SERVICE_NAME";
25+
public static final String SERVICE_UNDEFINED = "service_undefined";
2126
}

powertools-core/src/main/java/software/amazon/lambda/powertools/core/internal/LambdaHandlerProcessor.java

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,21 @@
2727
import static software.amazon.lambda.powertools.core.internal.SystemWrapper.getenv;
2828

2929
public final class LambdaHandlerProcessor {
30+
3031
// SERVICE_NAME cannot be final for testing purposes
31-
private static String SERVICE_NAME = null != System.getenv("POWERTOOLS_SERVICE_NAME")
32-
? System.getenv("POWERTOOLS_SERVICE_NAME") : "service_undefined";
32+
private static String SERVICE_NAME = calculateServiceName();
33+
3334
private static Boolean IS_COLD_START = null;
3435

3536
private LambdaHandlerProcessor() {
3637
// Hide default constructor
3738
}
3839

40+
private static String calculateServiceName() {
41+
return null != getenv(LambdaConstants.POWERTOOLS_SERVICE_NAME)
42+
? getenv(LambdaConstants.POWERTOOLS_SERVICE_NAME) : LambdaConstants.SERVICE_UNDEFINED;
43+
}
44+
3945
public static boolean isHandlerMethod(final ProceedingJoinPoint pjp) {
4046
return placedOnRequestHandler(pjp) || placedOnStreamHandler(pjp);
4147
}
@@ -56,23 +62,24 @@ public static boolean placedOnStreamHandler(final ProceedingJoinPoint pjp) {
5662

5763
public static Context extractContext(final ProceedingJoinPoint pjp) {
5864

59-
if (isHandlerMethod(pjp)) {
60-
if (placedOnRequestHandler(pjp)) {
61-
return (Context) pjp.getArgs()[1];
62-
}
63-
64-
if (placedOnStreamHandler(pjp)) {
65-
return (Context) pjp.getArgs()[2];
66-
}
65+
if (placedOnRequestHandler(pjp)) {
66+
return (Context) pjp.getArgs()[1];
67+
} else if (placedOnStreamHandler(pjp)) {
68+
return (Context) pjp.getArgs()[2];
69+
} else {
70+
return null;
6771
}
68-
69-
return null;
7072
}
7173

7274
public static String serviceName() {
7375
return SERVICE_NAME;
7476
}
7577

78+
// Method used for testing purposes
79+
protected static void resetServiceName() {
80+
SERVICE_NAME = calculateServiceName();
81+
}
82+
7683
public static boolean isColdStart() {
7784
return IS_COLD_START == null;
7885
}
@@ -82,13 +89,13 @@ public static void coldStartDone() {
8289
}
8390

8491
public static boolean isSamLocal() {
85-
return "true".equals(System.getenv("AWS_SAM_LOCAL"));
92+
return "true".equals(getenv(LambdaConstants.AWS_SAM_LOCAL));
8693
}
8794

8895
public static Optional<String> getXrayTraceId() {
89-
final String X_AMZN_TRACE_ID = getenv("_X_AMZN_TRACE_ID");
90-
if(X_AMZN_TRACE_ID != null) {
91-
return of(X_AMZN_TRACE_ID.split(";")[0].replace("Root=", ""));
96+
final String X_AMZN_TRACE_ID = getenv(LambdaConstants.X_AMZN_TRACE_ID);
97+
if (X_AMZN_TRACE_ID != null) {
98+
return of(X_AMZN_TRACE_ID.split(";")[0].replace(LambdaConstants.ROOT_EQUALS, ""));
9299
}
93100
return empty();
94101
}

0 commit comments

Comments
 (0)