
Process events in order by invoking an AWS Lambda function synchronously from a FIFO subscriber on an Amazon EventBridge custom event bus.
eventsv2 API) processes events in order by invoking an AWS Lambda function synchronously (InvocationType REQUEST_RESPONSE) from a FIFO subscriber.OrderPlaced events that share one EventGroupId, each carrying a monotonically increasing sequence number. The FIFO subscriber delivers one event per batch and invokes the consumer Lambda synchronously, waiting for each event to be confirmed before delivering the next in the group. The consumer logs each sequence number as it processes, and the CloudWatch log shows the sequence handled in order, one at a time. Synchronous confirmation gives the reliability and back-pressure that teams used to get by adding an SQS queue between the bus and Lambda, so no queue is needed.This pattern is available in the following frameworks/languages:
git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/eventbridge-custom-lambda-sync/python/samsam buildsam deploy --guided --capabilities CAPABILITY_NAMED_IAMsam delete