springwolf / springwolf-core

Automated documentation for event-driven applications built with Spring Boot
https://www.springwolf.dev
Apache License 2.0
255 stars 77 forks source link

feat: support for beanRef in KafkaListener annotation #1089

Open ruskaof opened 2 days ago

ruskaof commented 2 days ago

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

netlify[bot] commented 2 days ago

Deploy Preview for springwolf-ui canceled.

Name Link
Latest commit c0dc484371bb07a628fd3df9e10e4e0d05c0ba2b
Latest deploy log https://app.netlify.com/sites/springwolf-ui/deploys/673e498e11828900088cf298
ruskaof commented 8 hours ago

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?