Skip to content

BatchInterceptor is not working properly with retries #3166

Closed
@RuslanHryn

Description

@RuslanHryn

In what version(s) of Spring for Apache Kafka are you seeing this issue?

3.1.3, also reproducible on older versions as well

Describe the bug
No invocation of org.springframework.kafka.listener.BatchInterceptor#success after successful retry.
Also, only one invocation of org.springframework.kafka.listener.BatchInterceptor#failure for the first failure but no invocations for failed retries.

To Reproduce

Just use BatchInterceptor with retries.

Here is a test to reproduce the issue: https://github.com/RuslanHryn/kafka-batch-Interceptor-issue/blob/main/src/test/java/org/example/kafkabatchinterceptorissue/KafkaBatchInterceptorIssueTests.java

Expected behavior
org.springframework.kafka.listener.BatchInterceptor#success - will be invoked after a successful retry.
org.springframework.kafka.listener.BatchInterceptor#failure - will be invoked for every listener failure including retries.
Sample

here is the reproducer: https://github.com/RuslanHryn/kafka-batch-Interceptor-issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions