bbc / sqs-consumer

Build Amazon Simple Queue Service (SQS) based applications without the boilerplate
https://bbc.github.io/sqs-consumer/
Other
1.74k stars 333 forks source link

feat: adding acknowledgment to handleMessage #343

Closed nicholasgriffintn closed 1 year ago

nicholasgriffintn commented 1 year ago

In https://github.com/bbc/sqs-consumer/pull/255 we added the ability to acknowledge messages from the batch function, this allows user's to return an array of messages that their application has determined has succeeded.

These messages would then only be deleted and the message_processed emit would only be emitted if the message had been acknowledged.

We should provide this same functionality to individual messages, allowing applications to return an object containing the same messageId of the message that they wish to acknowledge, only then would the same conditions occur.

That's what this PR does.