Skip to content

Error handler throws an exception on blocking retries #3409

Closed
@lm231290

Description

@lm231290

version 3.1.2 - 3.2.2

When using blocking retries an back-off (e.g new FixedBackOff(5000, 2)), there is an error message in the log:

...KafkaMessageListenerContainer    : Error handler threw an exception
org.springframework.kafka.KafkaException: Seek to current after exception
...

I see two confusing things here:

  1. the log states that it is an exception of Error Handler, and occurred while seeking. Even though it has a real exception in Caused by, the beginning is wrong in my opinion because the Error Handler didn't fail handling my errors
  2. the log is printed after the back-off interval (5s in my example), right before the next attempt

To reproduce:

  • Create DefaultErrorHandler as a Spring bean
  • Set a back-off with a notable interval
  • Set this error handler in KafkaListenerContainerFactory used for the listener

Expected behavior

Either no error message at all, or log it right after the attempt fails, before the back-off pause, and with less confusing message

Sample

https://github.com/lm231290/kafka-tests

There is a retry.log file there with my execution example
Or you can run ListenerTest.test_single and see the log messages and the timestamps

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions