spring-projects / spring-kafka

Provides Familiar Spring Abstractions for Apache Kafka
https://projects.spring.io/spring-kafka
Apache License 2.0
2.17k stars 1.55k forks source link

Allow `@DltHandler` Method to be Defined in a parent class of class annotated with `@KafkaListener` #3463

Closed JooHyukKim closed 1 month ago

JooHyukKim commented 1 month ago

Expected Behavior

@DltHandler-annotated method may be in the same class or parent class as the corresponding @KafkaListener annotation.

Current Behavior

@DltHandler-annotated method must be in the same class as the corresponding @KafkaListener annotation.

Context

My usecase is that all our consumer class have their own listener method annotated with @RetryableTopic and @KafkaListener to define per-class specificRetryableTopic.retryTopicSuffix property. But all @DltHandler methods implementations are exactly the same. So it would be nice to allow the suggested behavior.

JooHyukKim commented 1 month ago

This sort of offshoot of #3183

artembilan commented 1 month ago

@JooHyukKim ,

The proposal is here: #3464

Thank you for looking into this!

JooHyukKim commented 1 month ago

LGTM, thank you for quick response!