Producer-consumer pattern using AWS Lambda, Amazon SNS, Amazon SQS

AWS Lambda → Amazon SNS → Amazon SQS → AWS Lambda

Create a Lambda producer that publishes to a Lambda consumer via SNS and SQS.

This pattern creates an two Lambda function, a producer and a consumer, an SNS topic and an SQS queue using SAM and Java 21.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/lambda-sns-sqs-lambda-sam-java

Deploy

sam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: sam delete --stack-name STACK_NAME.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"

Created by:

Razvan Minciuna

Razvan Minciuna

Software Architect.

Follow on LinkedIn