| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Build resilient, long-running AWS Lambda functions that automatically checkpoint progress and resume after failures. Durable functions can run for up to one year while you pay only for active compute time.
Your durable function extends DurableHandler<I, O> and implements handleRequest(I input, DurableContext ctx). The DurableContext is your interface to durable operations:
<dependency>
<groupId>software.amazon.lambda.durable</groupId>
<artifactId>aws-durable-execution-sdk-java</artifactId>
<version>VERSION</version>
</dependency>public class OrderProcessor extends DurableHandler<Order, OrderResult> {
@Override
protected OrderResult handleRequest(Order order, DurableContext ctx) {
// Step 1: Validate and reserve inventory
var reservation = ctx.step("reserve-inventory", Reservation.class,
stepCtx -> inventoryService.reserve(order.getItems()));
// Step 2: Process payment
var payment = ctx.step("process-payment", Payment.class,
stepCtx -> paymentService.charge(order.getPaymentMethod(), order.getTotal()));
// Wait for warehouse processing (no compute charges)
ctx.wait(null, Duration.ofHours(2));
// Step 3: Confirm shipment
var shipment = ctx.step("confirm-shipment", Shipment.class,
stepCtx -> shippingService.ship(reservation, order.getAddress()));
return new OrderResult(order.getId(), shipment.getTrackingNumber());
}
}See examples/README.md for complete instructions on local testing and running cloud integration tests.
See Deploy and invoke Lambda durable functions with the AWS CLI for more information on deploying and invoking durable functions.
See Deploy Lambda durable functions with Infrastructure as Code for more information on deploying durable functions using infrastructure-as-code.
Core Operations
Examples
Advanced Topics
See CONTRIBUTING for information about reporting security issues.
This project is licensed under the Apache-2.0 License. See LICENSE for details.
| Back | FazBrowse Home | New Git URL |