Skip to content

Commit

Permalink
Merge pull request #24 from pagarme/fix-attribute-names-value
Browse files Browse the repository at this point in the history
Fix attribute names value
  • Loading branch information
matheusvellone authored Nov 25, 2020
2 parents df4ff61 + 426ed5f commit ce365f8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions lib/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand All @@ -223,4 +223,4 @@ var Queue = function (_EventEmitter) {
return Queue;
}(_events.EventEmitter);

exports.default = Queue;
exports.default = Queue;
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sqs-quooler",
"version": "1.7.0",
"version": "1.7.1",
"description": "An abstraction of AWS SQS",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit ce365f8

Please sign in to comment.