springwolf-core icon indicating copy to clipboard operation
springwolf-core copied to clipboard

feat: support for beanRef in KafkaListener annotation

Open ruskaof opened this issue 1 year ago • 2 comments

this commit resolves #873

Hi, I'm new to this project so I'm not sure this is the best way to implement support for beanRef in KafkaListener annotation. Could you please review this MR? Most of the code comes from the spring kafka project https://github.com/spring-projects/spring-kafka/blob/main/spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaListenerAnnotationBeanPostProcessor.java

ruskaof avatar Nov 20 '24 20:11 ruskaof

Deploy Preview for springwolf-ui canceled.

Name Link
Latest commit 3667cef912d61a389c0be07a6ed5c31b9a35cf9d
Latest deploy log https://app.netlify.com/sites/springwolf-ui/deploys/674dd46a43568e000813ef3a

netlify[bot] avatar Nov 20 '24 20:11 netlify[bot]

Thanks for your review, @timonback ! I like your suggestions and I'll try to implement them. I believe that it is not possible to implement this feature without somehow passing the annotated class (or the class that declares the annotated method) to KafkaBindingFactory methods because the annotation itself does not provide any data on this.

Since one can use Kafkalister on both methods and classes, would it be right to make something like BindingContext<AnnotationType> class that contains the annotation itself and either annotated method or class and use it in the new BindingFactory methods?

ruskaof avatar Nov 22 '24 12:11 ruskaof