All Projects → alexanderjamesking → node-hello-aws-sns-sqs

alexanderjamesking / node-hello-aws-sns-sqs

Licence: other
Example of publishing to SNS topic and consuming SQS queue using aws-sdk-js

Programming Languages

javascript
184084 projects - #8 most used programming language

aws-sdk-js SQS SNS example

Very basic Node.js example to publish to SNS topic and consume via SQS queue.

AWS Admin Console

  1. Set up SNS Topic
  2. Set up SQS Queue
  3. Subscribe the Queue to the SNS Topic
  4. Set up IAM User and give the user access to SNS and SQS
  5. Create and download the IAM User credentials

Running locally

  1. Update credentials in config.json
  2. Update TopicArn in publishToSNSTopic.js
  3. Update QueueUrl in receiveMessageFromSQSQueue.js
  4. Install dependencies
npm install
  1. Publish a message to the topic
node publishToSNSTopic.js
  1. Check it appears in the list of messsages in SQS queue (AWS Admin Console)
  2. Receive the message then delete
node receiveMessageFromSQSQueue.js
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].