-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
In what version(s) of Spring for Apache Kafka are you seeing this issue?
>= 2.9.0
Describe the bug
It is stated in the documentation that
Starting with version 2.9, the DefaultErrorHandler can be configured to provide the same semantics as seeking the unprocessed record offsets as discussed below, but without actually seeking. Instead, the records are retained by the listener container and resubmitted to the listener after the error handler exits (and after performing a single paused poll(), to keep the consumer alive;
Listeners that receives a large amount of data will start to lag behind quickly if they encounter unexpected errors during processing because they are constantly paused and polling for a long time (by default the poll timeout is 5 seconds but could be larger if set otherwise by the user).
To Reproduce
Really easy to test, just throw any exception in a listener configured with a CommonLoggingErrorHandler and a poll timeout set to any large value.
The listener will be stuck for the duration of the poll timeout before processing the remaining records.
Expected behavior
Do not poll with the consumer paused before processing the remaining records (or at least poll with a shorter poll timeout) as it is not expecting to receive a record anyway.
This should probably be mentionned in the release notes as it seems small but is quite a big behavoural change and can lead to issues for some people upgrading to SpringBoot 3.