sqs-stream

Wrap Amazon SQS into Readable stream

Wraps Amazon SQS into Readable stream

Here is our in-use code snippet

topic = require 'sqs-stream'

topic.createReadStream({
  url: 'YOUR_SQS_QUEUE_URL',
  accessKeyId: 'your-access-key',
  secretAccessKey: 'your-access-secret',
  region: 'your-region'
}).pipe(process.stdout)
createReadStream(options)

create Readable Stream from given queue URL. available options are

  • options.url - URL of your SQS. e.g) https://sqs.ap-northeast-1.amazonaws.com/-some-number-/-some-name-you-used
  • options.accessKeyId - Your AWS access key(required)
  • options.secretAccessKey - Your AWS secret key(required)
  • options.region - Your AWS region(defaults to 'us-east-1' as aws-sdk does)
setConfig(options) # DEPRECATED

set AWS credentials, all parameters are just passed into aws-sdk. available options are

  • options.accessKeyId - Your AWS access key(required)
  • options.secretAccessKey - Your AWS secret key(required)
  • options.region - Your AWS region(defaults to 'us-east-1' as aws-sdk does)
  • Limit total number of messages
  • Give user way how to delete processed messages