Bloody simple SQS
A bloody simple Amazon SQS client for Node.js, based on the official AWS SDK.
Features
- Provides simple and sane interface to Amazon SQS;
- Exposes promise and callback API;
- Battle-tested under heavy load;
- Distributed under the MIT license.
Installation
$ npm install bloody-simple-sqs
Requirements
Quick start
Create a new SQS instance
var SQS = require('bloody-simple-sqs');
var queue = new SQS({
queueName: 'i-am-queue',
accessKeyId: 'AKIA-access-key',
secretAccessKey: 'secret-access-key',
region: 'us-east-1'
});
Append message to queue
queue.add({a: 1, b: 2})
.then(function (data) {
console.log('Message sucessfully appended to queue with id ' + data.id);
})
.catch(function (err) {
console.error(err);
});
Retrieve and remove message from queue
queue.poll({limit: 1, timeout: 20})
.then(function (message) {
if (message) {
console.log(message);
} else {
console.log('The queue has no messages');
}
})
.catch(function (err) {
console.error(err);
});
API Docs
For further information on Bloody Simple SQS methods please refer to the API Docs.
Contributors
Author: Dimitrios C. Michalakos
Acknowledgements
This project would not be without the extraordinary work of:
License
MIT