Stylishly SQS Message Handler
Installation
$ npm install -S @stylishly/sqs-message-handler
Usage
const messageHandler = new SQSMessageHandler({
sqs, // Instance of AWS.SQS http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SQS.html
queueName: some_queue_to_poll,
messageOptions: {
MaxNumberOfMessages: 10,
WaitTimeSeconds: 20,
MessageAttributeNames: [
'All'
]
},
handlerFunction: (messages) => {
// Do some stuff with the messages
}
});
Tests
To run the test suite, first install the dependencies, then run npm test:
$ npm install
$ npm test