-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Can configure @EnablePublisher(proxyTargetClass=true) #2695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please, make yourself familiar with GitHub comments formatting, especially about code snippets: https://help.github.com/articles/basic-writing-and-formatting-syntax/ You are welcome to come back to us with Contribution: https://github.com/spring-projects/spring-integration/blob/master/CONTRIBUTING.adoc |
Until the annotation is fixed, I added a work around here. |
Another issue is like this: https://stackoverflow.com/questions/54207305/spring-cloud-stream-streamlistener-processing-messages-twice. To reconsider the |
Fixes spring-projects#2695 To configure a `proxyTargetClass=true` we need declare a `PublisherAnnotationBeanPostProcessor` bean manually, but that may cause a confuse when `@EnablePublisher` is still present. So, target service is proxied twice * Expose `proxyTargetClass` and `order` into the `@EnablePublisher` and `<enable-publisher>` * Refactor `PublisherAnnotationBeanPostProcessor` to extend an `AbstractBeanFactoryAwareAdvisingPostProcessor` to avoid AOP boilerplate code altogether * Add assertion into the `PublisherAnnotationBeanPostProcessor` to be sure that only one of its instance is present in the application context
* GH-2695: Add proxy option to @EnablePublisher Fixes #2695 To configure a `proxyTargetClass=true` we need declare a `PublisherAnnotationBeanPostProcessor` bean manually, but that may cause a confuse when `@EnablePublisher` is still present. So, target service is proxied twice * Expose `proxyTargetClass` and `order` into the `@EnablePublisher` and `<enable-publisher>` * Refactor `PublisherAnnotationBeanPostProcessor` to extend an `AbstractBeanFactoryAwareAdvisingPostProcessor` to avoid AOP boilerplate code altogether * Add assertion into the `PublisherAnnotationBeanPostProcessor` to be sure that only one of its instance is present in the application context * * Polishing error message and Docs
Enhancement
Problem: As discussed in https://stackoverflow.com/questions/54150939/spring-cloud-stream-and-publisher-annotation-compatiblity/54151130, services using
@Publisher
annotation can't be injected using@Autowire
Possible solution: using an annotation like
@EnablePublisher(proxyTargetClass=true)
. Other proxy implementations of Spring like@Cacheable
or@Async
use this flag.The text was updated successfully, but these errors were encountered: