-
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
Rebalancing occurred for batch Kafka listener when non BatchListenerFailedException is thrown #3712
Comments
@user734879 Have you observed that when the |
@sobychacko yes, it works as expected when maxInterval is less than max.poll.interval (at the same time added sample project here https://github.com/user734879/spring-kafka-retry-test |
Thanks for the sample. Looks like this SO thread is related - https://stackoverflow.com/questions/79288249/containerpausingbackoffhandler-never-called I think what's happening is that even though you set the
and that Here is what the super constructor looks like:
So, on a quick look, it doesn't seem like the I don't see that the backoff handler is invoked in that path. This maybe by design. When batch records are retried, you either need to throw a |
Yes that's the behaviour I observed while debugging the issue..
I don't think so, unfortunately. Increasing it will impact the detection of really died consumers, while we just want to achieve ability to have longer retries/longer delays between retries. Is there any work around to tell listener "this is the last retry attempt - you can to not throw any exception and skip records itself", while for previous retries |
@sobychacko is there anything else required from me as a reporter (based on the label added) to proceed with analysis whether it can be fixed and is there any W/A to skip entire batch after retries exhausted available please? |
@user734879 Not at this point. We will have to triage it further and see what's going on. Possibly after the |
The
That
That one, in turn:
So, even if a Thank you! |
@artembilan the pause/resume itself is not enough - it should also do some poll operations in parallel to be considered alive (and receive 0 records since consumer is on pause). |
Got it! |
@artembilan yes, correct. |
I don't think this is OK, since retry here is really blocking. |
@artembilan sorry, two questions then
|
Right. We have same doubts. |
In what version(s) of Spring for Apache Kafka are you seeing this issue?
3.3.1
Describe the bug
Intention was to process entire batch of messages as a single entity and retry it several times, then skip/recover entire batch if all retries exhausted.
Throwing BatchListenerFailedException is not applicable since
Documentation suggests throwing non BatchListenerFailedException and it works only if backoff time is less than max.poll.interval. When delays are longer it causes rebalancing since FallbackBatchErrorHandler sleeps for backoff time between poll operations. Configuring ContainerPausingBackOffHandler as a backoff error handler in order to handle long delays does not have impact.
To Reproduce
Use batch Kafka listener which throws non-BatchListenerFailedException to retry entire batch of events.
Expected behavior
ContainerPausingBackOffHandler is applied when non-BatchListenerFailedException error is thrown.
Sample
Configuration of ErrorHandler:
The text was updated successfully, but these errors were encountered: