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

public class RetryWaitForCallbackExample extends DurableHandler<ApprovalRequest,String>
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.