[{"data":1,"prerenderedAt":169},["ShallowReactive",2],{"pattern-eventbridge-custom-lambda-sync-java-sam":3,"pattern-group-eventbridge-custom-lambda-sync-java-sam":60},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":16,"extension":17,"framework":18,"gitHub":19,"highlight":6,"introBox":23,"language":29,"level":30,"meta":31,"patternArch":32,"patternGroup":46,"patternGroupLabel":6,"resources":47,"stem":55,"testing":56,"videoId":6,"__hash__":59},"patterns\u002Fpatterns\u002Feventbridge-custom-lambda-sync-java-sam.json","Amazon EventBridge custom event bus to AWS Lambda with ordered, synchronous delivery",null,{"text":8},[9],"\u003Ccode>sam delete\u003C\u002Fcode>",[11],"content\u002Fcontributors\u002Fkurt-tometich.json",{"text":13},[14,15],"\u003Ccode>sam build\u003C\u002Fcode>","\u003Ccode>sam deploy --guided --capabilities CAPABILITY_NAMED_IAM\u003C\u002Fcode>","Process events in order by invoking an AWS Lambda function synchronously from a FIFO subscriber on an Amazon EventBridge custom event bus.","json","AWS SAM",{"template":20},{"patternPath":21,"templateFile":22},"eventbridge-custom-lambda-sync\u002Fjava\u002Fsam","template.yaml",{"headline":24,"text":25},"How it works",[26,27,28],"This pattern shows how an Amazon EventBridge custom event bus (the \u003Ccode>eventsv2\u003C\u002Fcode> API) processes events in order by invoking an AWS Lambda function synchronously (\u003Ccode>InvocationType\u003C\u002Fcode> \u003Ccode>REQUEST_RESPONSE\u003C\u002Fcode>) from a FIFO subscriber.","The publisher sends a sequence of \u003Ccode>OrderPlaced\u003C\u002Fcode> events that share one \u003Ccode>EventGroupId\u003C\u002Fcode>, each carrying a monotonically increasing sequence number. The FIFO subscriber invokes the consumer Lambda function 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 Amazon 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 Amazon SQS queue between the bus and Lambda, so no queue is needed.","This deploys one EventBridge custom event bus, one FIFO subscriber configured for synchronous invocation, one Java 21 Lambda function, an SQS dead-letter queue, and the delivery role.","Java","300",{},{"icon1":33,"icon2":38,"line1":42},{"x":34,"y":35,"service":36,"label":37},20,50,"eventbridge","Amazon EventBridge\nCustom event bus",{"x":39,"y":35,"service":40,"label":41},80,"lambda-event-functions","AWS Lambda\nConsumer",{"from":43,"to":44,"label":45},"icon1","icon2","FIFO, synchronous","eventbridge-custom-lambda-sync",{"bullets":48},[49,52],{"text":50,"link":51},"Amazon EventBridge event buses","https:\u002F\u002Fdocs.aws.amazon.com\u002Feventbridge\u002Flatest\u002Fuserguide\u002Feb-event-bus.html",{"text":53,"link":54},"Amazon EventBridge targets","https:\u002F\u002Fdocs.aws.amazon.com\u002Feventbridge\u002Flatest\u002Fuserguide\u002Feb-targets.html","patterns\u002Feventbridge-custom-lambda-sync-java-sam",{"text":57},[58],"See the GitHub repo for detailed testing instructions.","FKsSlSlJW_0TqPvnlOCbfioubpeNbgJqWGtuHtditI8",{"group":46,"pages":61,"overview":6},[62,83,113],{"id":4,"title":5,"architectureURL":6,"cleanup":63,"contributors":65,"deploy":66,"description":16,"extension":17,"framework":18,"gitHub":68,"highlight":6,"introBox":70,"language":29,"level":30,"meta":72,"patternArch":73,"patternGroup":46,"patternGroupLabel":6,"resources":77,"stem":55,"testing":81,"videoId":6,"__hash__":59},{"text":64},[9],[11],{"text":67},[14,15],{"template":69},{"patternPath":21,"templateFile":22},{"headline":24,"text":71},[26,27,28],{},{"icon1":74,"icon2":75,"line1":76},{"x":34,"y":35,"service":36,"label":37},{"x":39,"y":35,"service":40,"label":41},{"from":43,"to":44,"label":45},{"bullets":78},[79,80],{"text":50,"link":51},{"text":53,"link":54},{"text":82},[58],{"id":84,"title":85,"architectureURL":6,"cleanup":86,"contributors":88,"deploy":89,"description":16,"extension":17,"framework":18,"gitHub":91,"highlight":6,"introBox":94,"language":98,"level":30,"meta":99,"patternArch":100,"patternGroup":6,"patternGroupLabel":6,"resources":104,"stem":109,"testing":110,"videoId":6,"__hash__":112},"patterns\u002Fpatterns\u002Feventbridge-custom-lambda-sync-python-sam.json","Ordered processing with a synchronous AWS Lambda target on Amazon EventBridge",{"text":87},[9],[11],{"text":90},[14,15],{"template":92},{"patternPath":93,"templateFile":22},"eventbridge-custom-lambda-sync\u002Fpython\u002Fsam",{"headline":24,"text":95},[26,96,97],"The publisher sends a sequence of \u003Ccode>OrderPlaced\u003C\u002Fcode> events that share one \u003Ccode>EventGroupId\u003C\u002Fcode>, 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 deploys one EventBridge custom event bus, one FIFO subscriber configured for synchronous invocation, one Python 3.14 Lambda function, an SQS dead-letter queue (safety net), and the delivery role.","Python",{},{"icon1":101,"icon2":102,"line1":103},{"x":34,"y":35,"service":36,"label":37},{"x":39,"y":35,"service":40,"label":41},{"from":43,"to":44,"label":45},{"bullets":105},[106,107],{"text":50,"link":51},{"text":108,"link":54},"Invoking Lambda functions with the Amazon EventBridge","patterns\u002Feventbridge-custom-lambda-sync-python-sam",{"text":111},[58],"czVrdzMYia7hvQ_AKHpa0_Dw_2yDjG1OPXjeFBVXkwE",{"id":114,"title":85,"architectureURL":6,"cleanup":115,"contributors":118,"deploy":119,"description":123,"extension":17,"framework":18,"gitHub":124,"highlight":6,"introBox":128,"language":133,"level":30,"meta":134,"patternArch":135,"patternGroup":6,"patternGroupLabel":6,"resources":156,"stem":161,"testing":162,"videoId":6,"__hash__":168},"patterns\u002Fpatterns\u002Feventbridge-custom-lambda-sync-typescript-sam.json",{"text":116},[117],"Delete the stack: \u003Ccode>sam delete\u003C\u002Fcode>",[11],{"text":120},[121,122],"sam build --template infra\u002Ftemplate.yaml","sam deploy --guided --capabilities CAPABILITY_NAMED_IAM","Processes events in order by invoking an AWS Lambda function synchronously from a FIFO subscriber on an Amazon EventBridge custom event bus.",{"template":125},{"patternPath":126,"templateFile":127},"eventbridge-custom-lambda-sync\u002Ftypescript\u002Fsam","infra\u002Ftemplate.yaml",{"headline":24,"text":129},[130,131,132],"This pattern shows how an Amazon EventBridge custom event bus (the eventsv2 API) processes events in order by invoking an AWS Lambda function synchronously (`InvocationType` `REQUEST_RESPONSE`) from a FIFO subscriber.","The publisher sends a sequence of `OrderPlaced` events that share one `EventGroupId`, each carrying a monotonically increasing sequence number. The FIFO subscriber invokes the consumer AWS Lambda function 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 Amazon 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 Amazon SQS queue between the bus and AWS Lambda, so no Amazon SQS buffer sits in the path.","This deploys one Amazon EventBridge custom event bus, one FIFO subscriber configured for synchronous invocation, one Node.js 24 (TypeScript) AWS Lambda function, an Amazon SQS dead-letter queue (safety net), and the AWS Identity and Access Management (IAM) delivery role.","TypeScript",{},{"icon1":136,"icon2":138,"icon3":141,"icon4":145,"line1":149,"line2":151,"line3":153},{"x":137,"y":35,"service":36,"label":37},15,{"x":139,"y":35,"service":40,"label":140},40,"AWS Lambda",{"x":39,"y":142,"service":143,"label":144},30,"cloudwatch","Amazon CloudWatch",{"x":39,"y":146,"service":147,"label":148},70,"sqs","Amazon SQS DLQ",{"from":43,"to":44,"label":150},"FIFO, sync",{"from":44,"to":152},"icon3",{"from":44,"to":154,"label":155},"icon4","on failure",{"bullets":157},[158,159],{"text":50,"link":51},{"text":160,"link":54},"Invoking AWS Lambda functions with Amazon EventBridge","patterns\u002Feventbridge-custom-lambda-sync-typescript-sam",{"text":163},[164,165,166,167],"Run the offline unit tests: \u003Ccode>npm test\u003C\u002Fcode>","After deploying, publish an ordered sequence: \u003Ccode>scripts\u002Frun_publish.sh [stack-name] [region] [count]\u003C\u002Fcode>","Watch the consumer process the group in order: \u003Ccode>aws logs tail \u002Faws\u002Flambda\u002Fsync-orders-consumer --since 5m --format short\u003C\u002Fcode>","The 'Processing order ... seq=' lines appear in order (seq=1, then seq=2, then seq=3, ...), confirming ordered, synchronous delivery.","_kmTlGGWo_XJX2RBgs3nDA1UbnZFNu7JqyS0BFUhnSQ",1794652451969]