Breaking change from v14 onwards: Acknowledgement will now be explict #584
nicholasgriffintn
announced in
Announcements
Replies: 1 comment 1 reply
-
|
First to say I appreciate your work on this great library! Just my 2 cents. This breaking change will wreak thousands of systems of users who upgrade without looking at Releases. Auto-Acknowledge is a much more sensible default, users expect auto-acknowledge if there's no error. alwaysAcknowledge was exposed on 13 as well, documentation is there to help users understand how it works. Also, this is such a big change it should be on the home page of this github repo and on the doc website. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Version 14.0.0 introduces a breaking change to how message acknowledgment works. This change makes acknowledgment behaviour more explicit and predictable, addressing user confusion about when messages are acknowledged.
Previous versions of SQS Consumer would always acknowledge if nothing was returned.
From this version, implementations using SQS Consumer will either need to explicitly return the messages that they want to acknowledge (remove from the queue), or enable the
alwaysAcknowledgesetting to always acknowledge messages like how SQS Consumer previously worked.More information can be found below.
What Changed
Previous Behaviour (<=v13.x)
void(nothing) from handlers had implicit acknowledgment behaviourNew Behavior (>=v14.0)
void(nothing) means no acknowledgment by defaultBenefits of the New Approach
Migration Steps
handleMessage()
Step 1: Identify Your Current Handler Pattern
First, determine which pattern your current message handlers follow:
Step 2: Update Your Handlers
For Pattern A (Implicit Acknowledgment)
Option 1: Explicit Return
Option 2: Use alwaysAcknowledge
For Pattern B and C (Conditional Acknowledgment)
handleMessageBatch()
This is largely similar to the above recommendations, you just need to adjust to build up an array of the messages that you want to acknowledge and then return that array.
Configuration Options
alwaysAcknowledge Setting
Use this setting to maintain <=v13.x behavior during migration:
alwaysAcknowledge: trueshould be used as a temporary migration aid. The explicit return pattern is recommended for long-term maintainability.Beta Was this translation helpful? Give feedback.
All reactions