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:

  1. Prepare the request for approval
  2. Create a callback and send the callback ID to an external approval system
  3. Suspend execution until the external system responds
  4. Process the approval result

External systems respond using AWS Lambda APIs:

  • SendDurableExecutionCallbackSuccess - approve with result
  • SendDurableExecutionCallbackFailure - reject with error
  • SendDurableExecutionCallbackHeartbeat - keep callback alive
  • Constructor Details

    • CallbackExample

      public CallbackExample()
  • Method Details

    • handleRequest

      public String handleRequest(software.amazon.lambda.durable.examples.ApprovalRequest input, DurableContext context)
      Description copied from class: DurableHandler
      Handle the durable execution.
      Specified by:
      handleRequest in class DurableHandler<software.amazon.lambda.durable.examples.ApprovalRequest,String>
      Parameters:
      input - User input
      context - Durable context for operations
      Returns:
      Result