Amazon SNS to Amazon SQS fanout with filtering

Amazon SNS topic → Amazon SQS queue 1 → Amazon SQS queue 2

Creates SNS topic and SQS queues with message body based and attribute based filter using configuration file (appSettings.json)

This CDK application demonstrates how to create fanout pattern using a SNS topic and SQS queues with subscription filters.
Number of queues required and type of filter (Message attribute based or message body based) can be defined in appSettings.json (Sample json is provided, replace queue names and filter by conditions as needed).

< 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/sns-sqs-fanout-cdk-java

Deploy

cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk delete.

Created by:

Matt Ridehalgh

Matt Ridehalgh

Matt Ridehalgh is a Solutions Architect at AWS.

Follow on LinkedIn