Skip to content

Commit

Permalink
chore: clarify how acknowledgement works
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasgriffintn committed Nov 24, 2023
1 parent 88d2ad2 commit 2b87c33
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,13 @@ app.start();
```
- The queue is polled continuously for messages using [long polling](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html).
- Messages are deleted from the queue once the handler function has completed successfully.
- Throwing an error (or returning a rejected promise) from the handler function will cause the message to be left on the queue. An [SQS redrive policy](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/SQSDeadLetterQueue.html) can be used to move messages that cannot be processed to a dead letter queue.
- By default messages are processed one at a time – a new message won't be received until the first one has been processed. To process messages in parallel, use the `batchSize` option [detailed below](#options).
- By default, messages that are sent to the `handleMessage` and `handleMessageBatch` functions will be considered as processed if they return without an error. To acknowledge individual messages, please return the message that you want to acknowledge if you are using `handleMessage` or the messages for `handleMessageBatch`. It's also important to await any processing that you are doing to ensure that messages are processed one at a time.
- By default, messages that are sent to the `handleMessage` and `handleMessageBatch` functions will be considered as processed if they return without an error.
- To acknowledge individual messages, please return the message that you want to acknowledge if you are using `handleMessage` or the messages for `handleMessageBatch`.
- To also note, returning an object or an array will be considered an acknowledgement of no message(s) and will result in no messages being deleted.
- It's also important to await any processing that you are doing to ensure that messages are processed one at a time.
- Messages are deleted from the queue once the handler function has completed successfully (the above items should also be taken into account).
### Credentials
Expand Down

0 comments on commit 2b87c33

Please sign in to comment.