Skip to content

Commit a2c1b05

Browse files
authored
Merge branch 'main' into chore/cloud-testing
2 parents a978258 + 77ea80e commit a2c1b05

67 files changed

Lines changed: 2063 additions & 1320 deletions

File tree

Some content is hidden

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

.github/dependabot.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "maven"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
time: "09:00"
8+
timezone: "UTC"
9+
open-pull-requests-limit: 5
10+
commit-message:
11+
prefix: "[maven]"
12+
labels:
13+
- "dependencies"
14+
- "java"
15+
16+
- package-ecosystem: "github-actions"
17+
directory: "/.github/workflows"
18+
schedule:
19+
interval: "daily"
20+
time: "09:00"
21+
timezone: "UTC"
22+
open-pull-requests-limit: 5
23+
commit-message:
24+
prefix: "[github-actions]"
25+
labels:
26+
- "dependencies"
27+
- "github-actions"

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- 25
4949
steps:
5050
- name: Checkout repository
51-
uses: actions/checkout@v5
51+
uses: actions/checkout@v6
5252

5353
- name: Setup Java ${{ matrix.java }}
5454
uses: actions/setup-java@v5

.github/workflows/check-spotless.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
runs-on: ubuntu-latest
2828
steps:
2929
- name: Checkout repository
30-
uses: actions/checkout@v5
30+
uses: actions/checkout@v6
3131

3232
- name: Set up JDK 17
3333
uses: actions/setup-java@v5

.github/workflows/sync-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
runs-on: ubuntu-latest
3434
steps:
3535
- name: Git clone the repository
36-
uses: actions/checkout@v5
36+
uses: actions/checkout@v6
3737
- name: Set up JDK 17
3838
uses: actions/setup-java@v5
3939
with:
@@ -50,7 +50,7 @@ jobs:
5050
- name: Build with Maven
5151
run: mvn -B package --file pom.xml
5252
- name: configure aws credentials
53-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
53+
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7
5454
with:
5555
role-to-assume: "${{ secrets.ACTIONS_SYNC_ROLE_NAME }}"
5656
role-session-name: samplerolesession

README.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,22 @@ protected DurableConfig createConfiguration() {
384384

385385
The SDK throws specific exceptions to help you handle different failure scenarios:
386386

387-
| Exception | When Thrown | How to Handle |
388-
|-----------|-------------|---------------|
389-
| `StepFailedException` | Step exhausted all retry attempts | Catch to implement fallback logic or let execution fail |
390-
| `StepInterruptedException` | `AT_MOST_ONCE` step was interrupted before completion | Implement manual recovery (check if operation completed externally) |
391-
| `CallbackTimeoutException` | Callback exceeded its timeout duration | Implement fallback logic or escalation |
392-
| `CallbackFailedException` | External system sent an error response to the callback | Handle the error or propagate failure |
393-
| `NonDeterministicExecutionException` | Code changed between original execution and replay | Fix code to maintain determinism; don't change step order/names |
387+
```
388+
DurableExecutionException - General durable exception
389+
├── NonDeterministicExecutionException - Code changed between original execution and replay. Fix code to maintain determinism; don't change step order/names.
390+
├── SerDesException - Serialization and deserialization exception.
391+
└── DurableOperationException - General operation exception
392+
├── StepException - General Step exception
393+
│ ├── StepFailedException - Step exhausted all retry attempts.Catch to implement fallback logic or let execution fail.
394+
│ └── StepInterruptedException - `AT_MOST_ONCE` step was interrupted before completion. Implement manual recovery (check if operation completed externally)
395+
├── InvokeException - General chained invocation exception
396+
│ ├── InvokeFailedException - Chained invocation failed. Handle the error or propagate failure.
397+
│ ├── InvokeTimedoutException - Chained invocation timed out. Handle the error or propagate failure.
398+
│ └── InvokeStoppedException - Chained invocation stopped. Handle the error or propagate failure.
399+
└── CallbackException - General callback exception
400+
├── CallbackFailedException - External system sent an error response to the callback. Handle the error or propagate failure
401+
└── CallbackTimeoutException - Callback exceeded its timeout duration. Handle the error or propagate the failure
402+
```
394403

395404
```java
396405
try {

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<plugin>
7878
<groupId>org.apache.maven.plugins</groupId>
7979
<artifactId>maven-shade-plugin</artifactId>
80-
<version>3.5.1</version>
80+
<version>3.6.1</version>
8181
<configuration>
8282
<createDependencyReducedPom>false</createDependencyReducedPom>
8383
</configuration>

examples/src/main/java/com/amazonaws/lambda/durable/examples/ErrorHandlingExample.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.amazonaws.lambda.durable.DurableHandler;
77
import com.amazonaws.lambda.durable.StepConfig;
88
import com.amazonaws.lambda.durable.StepSemantics;
9+
import com.amazonaws.lambda.durable.exception.StepFailedException;
910
import com.amazonaws.lambda.durable.exception.StepInterruptedException;
1011
import com.amazonaws.lambda.durable.retry.RetryStrategies;
1112
import org.slf4j.Logger;
@@ -85,7 +86,9 @@ public String handleRequest(Object input, DurableContext context) {
8586
.semantics(StepSemantics.AT_MOST_ONCE_PER_RETRY)
8687
.build());
8788
} catch (StepInterruptedException e) {
88-
logger.warn("Payment step interrupted, checking external status: {}", e.getOperationId());
89+
logger.warn(
90+
"Payment step interrupted, checking external status: {}",
91+
e.getOperation().id());
8992
// In real code: check payment provider for transaction status
9093
// If payment went through, return success; otherwise, handle appropriately
9194
paymentResult = context.step("verify-payment-status", String.class, () -> "verified-payment");

examples/src/test/java/com/amazonaws/lambda/durable/examples/CloudBasedIntegrationTest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,23 @@ void testSimpleStepExample() {
6868
assertEquals("create-greeting", createGreetingOp.getName());
6969
}
7070

71+
@Test
72+
void testSimpleInvokeExample() {
73+
var runner = CloudDurableTestRunner.create(arn("simple-invoke-example"), Map.class, String.class);
74+
var result = runner.run(Map.of("message", "test"));
75+
76+
assertEquals(ExecutionStatus.SUCCEEDED, result.getStatus());
77+
assertNotNull(result.getResult(String.class));
78+
79+
var createGreetingOp = runner.getOperation("call-greeting1");
80+
assertNotNull(createGreetingOp);
81+
assertEquals("call-greeting1", createGreetingOp.getName());
82+
83+
var createGreetingOp2 = runner.getOperation("call-greeting2");
84+
assertNotNull(createGreetingOp);
85+
assertEquals("call-greeting2", createGreetingOp2.getName());
86+
}
87+
7188
@Test
7289
void testRetryExample() {
7390
var runner = CloudDurableTestRunner.create(arn("retry-example"), String.class, String.class);

examples/template.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ Resources:
3737
DurableConfig:
3838
ExecutionTimeout: 300
3939
RetentionPeriodInDays: 7
40-
Policies:
41-
- Statement:
42-
- Effect: Allow
43-
Action:
44-
- lambda:CheckpointDurableExecutions
45-
- lambda:GetDurableExecutionState
46-
Resource: !Sub "arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:simple-step-example"
4740
Metadata:
4841
Dockerfile: !Ref DockerFile
4942
DockerContext: ../

pom.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
<maven.compiler.source>17</maven.compiler.source>
2424
<maven.compiler.target>17</maven.compiler.target>
2525
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
26-
<aws.sdk.version>2.40.16</aws.sdk.version>
27-
<jackson.version>2.20.0</jackson.version>
28-
<junit.version>5.14.1</junit.version>
29-
<mockito.version>5.20.0</mockito.version>
26+
<aws.sdk.version>2.41.25</aws.sdk.version>
27+
<jackson.version>2.21.0</jackson.version>
28+
<junit.version>6.0.2</junit.version>
29+
<mockito.version>5.21.0</mockito.version>
3030
<slf4j.version>2.0.17</slf4j.version>
3131
<jacoco.version>0.8.14</jacoco.version>
32-
<spotless.version>3.1.0</spotless.version>
32+
<spotless.version>3.2.1</spotless.version>
3333
</properties>
3434

3535
<dependencyManagement>
@@ -87,7 +87,7 @@
8787
<plugin>
8888
<groupId>org.apache.maven.plugins</groupId>
8989
<artifactId>maven-compiler-plugin</artifactId>
90-
<version>3.14.1</version>
90+
<version>3.15.0</version>
9191
</plugin>
9292
<plugin>
9393
<groupId>org.apache.maven.plugins</groupId>

0 commit comments

Comments
 (0)