-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to commit offsets when publishing to dead letter topic. #990
Comments
Resolves spring-projects#990 Provide a mechanism to start a new transaction within which to invoke the processor, so if it recovers the failed record, its offset can be sent to the transaction.
Resolves spring-projects#990 Provide a mechanism to start a new transaction within which to invoke the processor, so if it recovers the failed record, its offset can be sent to the transaction. **cherry-pick to 2.2.x**
Resolves #990 Provide a mechanism to start a new transaction within which to invoke the processor, so if it recovers the failed record, its offset can be sent to the transaction. **cherry-pick to 2.2.x**
Resolves #990 Provide a mechanism to start a new transaction within which to invoke the processor, so if it recovers the failed record, its offset can be sent to the transaction. **cherry-pick to 2.2.x** # Conflicts: # spring-kafka/src/main/java/org/springframework/kafka/listener/DeadLetterPublishingRecoverer.java
Rename property to `commitRecovered`.
Rename property to `commitRecovered`.
Rename property to `commitRecovered`.
Rename property to `commitRecovered`.
Rename property to `commitRecovered`.
Rename property to `commitRecovered`.
Resolves spring-projects/spring-kafka#990 Provide a mechanism to start a new transaction within which to invoke the processor, so if it recovers the failed record, its offset can be sent to the transaction. **cherry-pick to 2.2.x**
See #990 Property rename was not back-ported.
Sorry to write to this already closed ticket, if you think i should open a new one please let me know. But my problem fits perfectly to the title of this issue. So i want to have an explicit commit after a dead letter was send. I want to avoid sending a dlq duplicate (or more if the are in a row) after a consumer restart. I'm not sure if the solution inside of DefaultAfterRollbackProcessor works for me. |
Commenting on old, closed, issues is not a good idea; especially when unrelated since you are not using transactions. The default behavior in supported versions is to commit the offset after an error handler successfully "handles" the error - see If you are seeing different behavior, open a new issue, providing a minimal, complete, reproducible example. |
Thanks for answering @garyrussell You are right that this is not the best place. But if i might ask you one more question: I use the DefaultErrorHandler with an DeadLetterPublishingRecoverer inside. I have a integration test and it seems like there is no commit / ack for a dead letter "recovered" entry. |
Lines 2730 to 2731 in 8a23e47
and Lines 2750 to 2764 in 8a23e47
Bear in mind that the actual commit depends on the AckMode if the default, BATCH is used, the commit won't happen until the remaining records from the poll have been processed. To commit immediately, use AckMode.RECORD .
Lines 2940 to 2966 in 8a23e47
|
Thx @garyrussell for the detail explanation! Now it works! The issue on my side was that i wanted to manually ack inside the listener, so i have set upped MANUAL_IMMEDIATE as the |
Affects Version(s): latest
When max retries is reached, the DefaultAfterRollbackProcessor uses seek to skip the failing record. This means that the record will be processed when the app is restarted.
To work around this I extended the DeadLetterPublishingRecoverer to also commit the offset.
Alternatively the DefaultAfterRollbackProcessor could be configured to commit the offsets after rolling back the main transaction.
https://stackoverflow.com/questions/55023117/kafkatemplate-in-transactional-kafkalistener-publishes-messages-when-transaction
The text was updated successfully, but these errors were encountered: