Skip to content

New serverless pattern - lambda-durable-execution-java-cdk#3074

Open
NithinChandranR-AWS wants to merge 2 commits intoaws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-lambda-durable-execution-java-cdk
Open

New serverless pattern - lambda-durable-execution-java-cdk#3074
NithinChandranR-AWS wants to merge 2 commits intoaws-samples:mainfrom
NithinChandranR-AWS:NithinChandranR-AWS-feature-lambda-durable-execution-java-cdk

Conversation

@NithinChandranR-AWS
Copy link
Copy Markdown

New Serverless Pattern: Lambda Durable Execution with Java SDK

Description

Deploys a Lambda durable function written in Java that orchestrates a multi-step order processing workflow with automatic checkpointing and failure recovery using the Durable Execution SDK for Java (v1.0.1, GA April 2026).

Architecture

Invoke → Lambda Durable Function (Java 17, Docker)
  Step 1: Validate Order ✓ checkpoint
  Step 2: Reserve Inventory ✓ checkpoint
  Step 3: Process Payment ✓ checkpoint
  Wait:   Warehouse Processing (zero compute) ✓ checkpoint
  Step 4: Confirm Shipment ✓ checkpoint

Key Features

  • First Java-based durable execution pattern in this repo
  • DurableHandler<Map, Map> base class with DurableContext
  • ctx.step() for checkpointed operations, ctx.wait() for zero-cost suspension
  • Docker-based Java 17 Lambda with Maven build
  • CDK TypeScript infrastructure with DurableConfig escape hatch
  • If interrupted, replays from beginning but skips completed steps

Framework / Language

  • AWS CDK (TypeScript)
  • Lambda: Java 17 (Docker image)

Deployment & Testing

  • Deployed and tested successfully on AWS
  • All 5 workflow steps complete with checkpointing
  • Durable execution status visible in Lambda console

Files

File Purpose
lib/lambda-durable-execution-java-stack.ts CDK stack
src/main/java/com/example/OrderProcessor.java Java handler
src/pom.xml Maven config with durable SDK dependency
src/Dockerfile Java 17 Lambda container
example-pattern.json Serverless Land metadata

… Java SDK pattern

Deploy a resilient multi-step order processing workflow using the AWS
Lambda Durable Execution SDK for Java (v1.0.1) with automatic
checkpointing and failure recovery.

Key features:
- DurableHandler<Map, Map> base class with DurableContext
- 5-step workflow: validate, reserve, pay, wait, ship
- ctx.step() for checkpointed operations
- ctx.wait() for zero-compute-cost suspension
- Docker-based Java 17 Lambda with Maven build
- CDK TypeScript infrastructure with DurableConfig escape hatch
Replace inline durable execution policy (wildcard resources) with the
AWS managed policy for least-privilege IAM, matching the approach
recommended in PR aws-samples#3053 review feedback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants