-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
GH-2588: ARBP support batch recoverable #2888
Conversation
...ng-kafka/src/main/java/org/springframework/kafka/listener/DefaultAfterRollbackProcessor.java
Outdated
Show resolved
Hide resolved
Can you provide a valid use case where this would be useful? Any transactional sends for the records before the failed one would have been rolled back, so it doesn’t make sense to to skip those records on the retry. If you are not doing transactional sends, then why use transactions? I tried to convey this in my comments on the issue. |
Exactly right, this is the most important point in this issue. |
One more time - we cannot support Yes, we could support recovering (sending to DLT) the entire batch, but we can't discard a partial batch here. Even that would have to be an opt-in feature. |
This comment was marked as resolved.
This comment was marked as resolved.
Re-running now; that test is sometimes flaky. |
Thanks |
please, rebase your branch to the latest Then we will start looking into your change to incorporate it into a new version. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we also need to document the feature somehow?
Thanks
spring-kafka/src/main/java/org/springframework/kafka/listener/ContainerProperties.java
Outdated
Show resolved
Hide resolved
...ng-kafka/src/main/java/org/springframework/kafka/listener/DefaultAfterRollbackProcessor.java
Outdated
Show resolved
Hide resolved
spring-kafka/src/main/java/org/springframework/kafka/listener/ListenerUtils.java
Outdated
Show resolved
Hide resolved
spring-kafka/src/main/java/org/springframework/kafka/listener/SeekUtils.java
Show resolved
Hide resolved
spring-kafka/src/test/java/org/springframework/kafka/listener/CommitOnAssignmentTests.java
Outdated
Show resolved
Hide resolved
6978f2d
to
ebd5a7d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, also add your name to the @author
list of all the affected classes.
Thanks
spring-kafka-docs/src/main/antora/modules/ROOT/pages/kafka/annotation-error-handling.adoc
Outdated
Show resolved
Hide resolved
spring-kafka/src/main/java/org/springframework/kafka/listener/AfterRollbackProcessor.java
Show resolved
Hide resolved
spring-kafka/src/main/java/org/springframework/kafka/listener/ContainerProperties.java
Show resolved
Hide resolved
...ng-kafka/src/main/java/org/springframework/kafka/listener/DefaultAfterRollbackProcessor.java
Show resolved
Hide resolved
spring-kafka/src/main/java/org/springframework/kafka/listener/ListenerUtils.java
Show resolved
Hide resolved
spring-kafka/src/main/java/org/springframework/kafka/listener/SeekUtils.java
Show resolved
Hide resolved
45f283d
to
1f5dd35
Compare
...fka/src/test/java/org/springframework/kafka/listener/DefaultAfterRollbackProcessorTests.java
Show resolved
Hide resolved
spring-kafka/src/test/java/org/springframework/kafka/listener/TransactionalContainerTests.java
Outdated
Show resolved
Hide resolved
spring-kafka/src/test/java/org/springframework/kafka/listener/TransactionalContainerTests.java
Outdated
Show resolved
Hide resolved
…ckProcessor` * add method processBatch at `AfterRollbackProcessor` * add opt-in property `batchRecoverAfterRollback` at `ContainerProperties` * change format to `BatchListenerFailedException.getMessage` * add batch recoverable after rollback unit test
* `what-new.adoc` and `annotation-error-handling.adoc` * add javadoc in `SeekUtils` and `AfterRollbackProcessor` * change `ListenerUtils.nextBackOff` public to default * change logger args to static string
* @author classes. * fix adoc * poblish `AfterRollbackProcessor` * javadoc at `ContainerProperties`
* add @test to DefaultAfterRollbackProcessorTests.testNoEarlyExitBackOff * polish TransactionalContainerTests * fix bug Tests at DefaultAfterRollbackProcessorTests method `testNoEarlyExitBackOff` and testEarlyExitBackOff
@artembilan @garyrussell @sobychacko Thanks for review, this issue could not have been solved without your guidance. |
Resolves #2588
This is a draft of support DLT batch recover for
DefaultAfterRollbackProcessor
. so we can evaluate if it's going in the right direction before doing a final review, adding docs, etc.Function
batchRecoverAfterRollback
atContainerProperties
AfterRollbackProcessor
Batch recoverable
exception handler logic