diff --git a/README.md b/README.md index 5256a53..d992a68 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Handler function should accept 2 arguments, the first one being the parsed messa The options object is optional and accept the following properties: - `keepMessages` (boolean): To avoid deleting the message after processing it. Default is `false`. -- `messageAttributesNames` (string array): The value which will be sent to the `receiveMessage` SQS method at the `MessageAttributeNames` property. Default value is `['ALL']`. +- `messageAttributesNames` (string array): The value which will be sent to the `receiveMessage` SQS method at the `MessageAttributeNames` property. Default value is `['All']`. After the handler returns (if it returns a Promise, SQS Quooler will wait for it to resolve), the item is automatically deleted from the queue. If your handler throws an error, or returns a rejected Promise, the item will not be removed from the queue. diff --git a/lib/queue.js b/lib/queue.js index c3b8a58..daf723e 100644 --- a/lib/queue.js +++ b/lib/queue.js @@ -200,7 +200,7 @@ var Queue = function (_EventEmitter) { return _bluebird2.default.resolve(self.options.sqs.receiveMessage({ QueueUrl: self.options.endpoint, MaxNumberOfMessages: self.options.concurrency, - MessageAttributeNames: options.messageAttributeNames || ['ALL'] + MessageAttributeNames: options.messageAttributeNames || ['All'] }).promise()).get('Messages').then(coerce).map(processItem).tap(delay).then(runAgain).catch(handleCriticalError); }; @@ -223,4 +223,4 @@ var Queue = function (_EventEmitter) { return Queue; }(_events.EventEmitter); -exports.default = Queue; \ No newline at end of file +exports.default = Queue; diff --git a/package-lock.json b/package-lock.json index 4c29ec6..7fd071a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "sqs-quooler", - "version": "1.7.0", + "version": "1.7.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index df9b9f3..b0da36a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sqs-quooler", - "version": "1.7.0", + "version": "1.7.1", "description": "An abstraction of AWS SQS", "license": "MIT", "repository": { diff --git a/src/queue.js b/src/queue.js index ccef591..d31451f 100644 --- a/src/queue.js +++ b/src/queue.js @@ -112,7 +112,7 @@ export default class Queue extends EventEmitter { .receiveMessage({ QueueUrl: self.options.endpoint, MaxNumberOfMessages: self.options.concurrency, - MessageAttributeNames: options.messageAttributeNames || ['ALL'], + MessageAttributeNames: options.messageAttributeNames || ['All'], }) .promise()) .get('Messages')