Example applications demonstrating the AWS Lambda Durable Execution SDK for Java.
- Java 17+
- Maven 3.8+
- AWS SAM CLI (for deployment)
- Docker (for SAM build)
- AWS credentials configured
Run examples locally without deploying to AWS using LocalDurableTestRunner:
# Build and install the SDK to local Maven repo (required since SDK is not yet published)
mvn clean install -DskipTests # from project root
cd examples
# Run all tests
mvn test
# Run specific test
mvn test -Dtest=SimpleStepExampleTestThe local runner executes in-memory and skips wait durations—ideal for fast iteration and CI/CD.
cd examples
mvn clean package
sam build
sam deploy --guidedOn first deploy, SAM will prompt for stack name and region. Subsequent deploys use saved config:
sam deployThe SAM template configures:
DurableConfigwithExecutionTimeoutandRetentionPeriodInDays- IAM permissions for
lambda:CheckpointDurableExecutionsandlambda:GetDurableExecutionState
sam remote invoke SimpleStepExampleFunction \
--event '{"name":"World"}' \
--stack-name durable-sdk-examplesRun tests against deployed functions using CloudDurableTestRunner:
cd examples
mvn test -Dtest=CloudBasedIntegrationTest -Dtest.cloud.enabled=trueThe tests auto-detect your AWS account and region from credentials. Override if needed:
mvn test -Dtest=CloudBasedIntegrationTest \
-Dtest.cloud.enabled=true \
-Dtest.aws.account=123456789012 \
-Dtest.aws.region=us-east-1| Example | Description |
|---|---|
| SimpleStepExample | Basic sequential steps |
| WaitExample | Suspend execution with wait() |
| RetryExample | Configuring retry strategies |
| ErrorHandlingExample | Handling StepFailedException and StepInterruptedException |
| GenericTypesExample | Working with List<T> and Map<K,V> |
| CustomConfigExample | Custom Lambda client and SerDes |
| WaitAtLeastExample | Concurrent stepAsync() with wait() |
| WaitAsyncExample | Non-blocking waitAsync() with concurrent step |
| RetryInProcessExample | In-process retry with concurrent operations |
| WaitAtLeastInProcessExample | Wait completes before async step (no suspension) |
| ManyAsyncStepsExample | Performance test with 500 concurrent async steps |
sam delete