Class CallbackExample
java.lang.Object
software.amazon.lambda.durable.DurableHandler<software.amazon.lambda.durable.examples.ApprovalRequest,String>
software.amazon.lambda.durable.examples.CallbackExample
- All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.RequestStreamHandler
public class CallbackExample
extends DurableHandler<software.amazon.lambda.durable.examples.ApprovalRequest,String>
Example demonstrating callback operations for external system integration.
This handler demonstrates a human approval workflow:
- Prepare the request for approval
- Create a callback and send the callback ID to an external approval system
- Suspend execution until the external system responds
- Process the approval result
External systems respond using AWS Lambda APIs:
SendDurableExecutionCallbackSuccess- approve with resultSendDurableExecutionCallbackFailure- reject with errorSendDurableExecutionCallbackHeartbeat- keep callback alive
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhandleRequest(software.amazon.lambda.durable.examples.ApprovalRequest input, DurableContext context) Handle the durable execution.Methods inherited from class software.amazon.lambda.durable.DurableHandler
createConfiguration, createObjectMapper, getConfiguration, handleRequest
-
Constructor Details
-
CallbackExample
public CallbackExample()
-
-
Method Details
-
handleRequest
public String handleRequest(software.amazon.lambda.durable.examples.ApprovalRequest input, DurableContext context) Description copied from class:DurableHandlerHandle the durable execution.- Specified by:
handleRequestin classDurableHandler<software.amazon.lambda.durable.examples.ApprovalRequest,String> - Parameters:
input- User inputcontext- Durable context for operations- Returns:
- Result
-