Skip to content

Commit

Permalink
Task: Update README
Browse files Browse the repository at this point in the history
* pass options through to SQS constructor
  • Loading branch information
niklasR committed Oct 31, 2017
1 parent 6440d7f commit a460485
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,20 @@ npm install sqs-producer --save
```js
var Producer = require('sqs-producer');

// create simple consumer
var producer = Producer.create({
queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name',
region: 'eu-west-1'
});

// create custom producer (supporting all opts as per the API docs: http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SQS.html#constructor-property)
var producer = Producer.create({
queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name',
region: 'eu-west-1'
accessKeyId: 'yourAccessKey',
secretAccessKey: 'yourSecret'
});

// send messages to the queue
producer.send(['msg1', 'msg2'], function(err) {
if (err) console.log(err);
Expand Down

0 comments on commit a460485

Please sign in to comment.