-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow @DltHandler
Method to be Defined in a parent class of class annotated with @KafkaListener
#3463
Comments
This sort of offshoot of #3183 |
artembilan
added a commit
to artembilan/spring-kafka
that referenced
this issue
Aug 28, 2024
Fixes: spring-projects#3463 Currently, a `@DltHandler`-annotated method must be in the same class as the corresponding `@KafkaListener` annotation. Some logic might be really the same for different `@KafkaListener` services. * Use `MethodIntrospector` in the `RetryableTopicAnnotationProcessor` to be able to process methods from super classes as well
The proposal is here: #3464 Thank you for looking into this! |
LGTM, thank you for quick response! |
sobychacko
pushed a commit
that referenced
this issue
Aug 28, 2024
Fixes: #3463 Currently, a `@DltHandler`-annotated method must be in the same class as the corresponding `@KafkaListener` annotation. Some logic might be the same for different `@KafkaListener` services. * Use `MethodIntrospector` in the `RetryableTopicAnnotationProcessor` to be able to process methods from super classes as well **Auto-cherry-pick to `3.2.x` & `3.1.x`**
spring-builds
pushed a commit
that referenced
this issue
Aug 28, 2024
Fixes: #3463 Currently, a `@DltHandler`-annotated method must be in the same class as the corresponding `@KafkaListener` annotation. Some logic might be the same for different `@KafkaListener` services. * Use `MethodIntrospector` in the `RetryableTopicAnnotationProcessor` to be able to process methods from super classes as well (cherry picked from commit 4dc0976)
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
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.
The text was updated successfully, but these errors were encountered: