-
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
Allow to log errors if "Retrying Complete Batches" happen #2395
Comments
Are you saying it worked in 2.7.x? |
Yes, it worked in 2.7.x but instead of extending In 2.7.x we were able to achieve our goal which is to log transient errors (other than |
Just for background... The equivalent of the fallback behavior (when not throwing a The The preferred mechanism is to throw the I have no issues providing a hook for you to log transient errors in this case, I just wanted to understand. |
Thank you. Sure! I guess you have some doubts that In class
And with such error handler I can catch
|
Resolves spring-projects#2395 Previously, `RetryListener` only supported record listeners; add methods for retrying batches. **cherry-pick to 2.9.x, 2.8.x**
Resolves spring-projects#2395 Previously, `RetryListener` only supported record listeners; add methods for retrying batches. **cherry-pick to 2.9.x, 2.8.x**
Resolves #2395 Previously, `RetryListener` only supported record listeners; add methods for retrying batches. **cherry-pick to 2.9.x, 2.8.x**
Resolves #2395 Previously, `RetryListener` only supported record listeners; add methods for retrying batches. **cherry-pick to 2.9.x, 2.8.x** # Conflicts: # spring-kafka/src/main/java/org/springframework/kafka/listener/ErrorHandlingUtils.java
Resolves #2395 Previously, `RetryListener` only supported record listeners; add methods for retrying batches. **cherry-pick to 2.9.x, 2.8.x** # Conflicts: # spring-kafka/src/main/java/org/springframework/kafka/listener/ErrorHandlingUtils.java # Conflicts: # spring-kafka/src/main/java/org/springframework/kafka/listener/FailedBatchProcessor.java
@garyrussell I built spring-kafka from |
Expected Behavior
Allow to extend or configure
DefaultErrorHandler
(which useFixedBackOff.UNLIMITED_ATTEMPTS
) in such way that if "Retrying Complete Batches" happen (see spring-kafka documentation) then it is possible to log transient error.Current Behavior
Spring-kafka logs error only if reties are exhausted. If applications have to retry forever in case of transient error (for example some external application is not available but is needed to process each message) then no errors are logged at all.
There are two solutions for that problem:
@KafkaListener
,DefaultErrorHandler
and log errors inside of overwritten methods.The second method works perfectly except when "Retrying Complete Batches" takes place. In this case DefaultErrorHandler methods are not called at all.
Context
This issue stops my team from upgrading from spring-kafka 2.7.* to 2.8.*.
I would prefer to use second solution described above without using fist solution.
I did not find any alternatives to achieve same goal.
The only workaround I found is to use second method and log non-BatchListenerFailedException errors in method annotated with
@KafkaListener
.The text was updated successfully, but these errors were encountered: