Class RetryWaitForCallbackExample
java.lang.Object
software.amazon.lambda.durable.DurableHandler<ApprovalRequest,String>
software.amazon.lambda.durable.examples.callback.RetryWaitForCallbackExample
- All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.RequestStreamHandler
Example demonstrating
context.withRetry with context.waitForCallback.
Submits an approval request to an external system via a callback. If the callback fails (e.g., the external system rejects the request), the helper retries the entire waitForCallback cycle — creating a fresh callback with a new ID each time.
Each attempt uses a unique callback name ("approval-1", "approval-2", etc.) so the execution
history stays clean and replay-safe. A null name is used, so attempts are grouped under a default-named child
context.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleRequest(ApprovalRequest input, DurableContext context) Handle the durable execution.Methods inherited from class software.amazon.lambda.durable.DurableHandler
createConfiguration, getConfiguration, handleRequest
-
Constructor Details
-
RetryWaitForCallbackExample
public RetryWaitForCallbackExample()
-
-
Method Details
-
handleRequest
Description copied from class:DurableHandlerHandle the durable execution.- Specified by:
handleRequestin classDurableHandler<ApprovalRequest,String> - Parameters:
input- User inputcontext- Durable context for operations- Returns:
- Result
-