Very basic Node.js example to publish to SNS topic and consume via SQS queue.
- Set up SNS Topic
- Set up SQS Queue
- Subscribe the Queue to the SNS Topic
- Set up IAM User and give the user access to SNS and SQS
- Create and download the IAM User credentials
- Update credentials in config.json
- Update TopicArn in publishToSNSTopic.js
- Update QueueUrl in receiveMessageFromSQSQueue.js
- Install dependencies
npm install
- Publish a message to the topic
node publishToSNSTopic.js
- Check it appears in the list of messsages in SQS queue (AWS Admin Console)
- Receive the message then delete
node receiveMessageFromSQSQueue.js