-
Notifications
You must be signed in to change notification settings - Fork 704
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
Resolve bean post processor warnings #1361
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @hpoettker thanks for the PR. Looks good. Please add your full name and surname with the @author
tag the javadocs of all the classes you've modified.
d921909
to
ca9fd2e
Compare
@OlgaMaciaszek done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This reverts commit 4e6540b. # Conflicts: # spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/reactive/LoadBalancerBeanPostProcessorAutoConfiguration.java
@hpoettker Had to revert these changes as, unfortunately, they were messing up native images: https://ge.spring.io/s/elz5iwbaoj2me . Have tried using an |
This reverts commit 246bc32.
@OlgaMaciaszek Thanks for the notice. I think we've run into spring-projects/spring-framework#29309. I could reproduce the problem locally. The Are you interested in a PR with the |
@hpoettker - yes, that's right. This should fix it: https://github.com/spring-cloud/spring-cloud-commons/tree/use-object-provider-for-lb-restclient-postprocessor |
Introduction
The PR resolves the remaining warnings about beans not being eligible for getting processed by all
BeanPostProcessor
s. Similar warnings have been reported in #1315 and fixed in #1319.The warnings do not indicate a severe issue. But they lead to confusion among users and bad getting started experiences. And as the size of the PR shows, the required change is rather small.
Reproducing the issue
The effectiveness of the change can be seen in the following tests:
LoadBalancerRequestFactoryConfigurationTests
ReactorLoadBalancerClientAutoConfigurationTests
Without the change, the test
LoadBalancerRequestFactoryConfigurationTests
logs the following warnings:Without the change, the test
ReactorLoadBalancerClientAutoConfigurationTests
logs the following warnings:With the change, no such warnings appear.
How it works
The PR works by using two mechanisms:
static
, the respective configuration class no longer needs to be instantiated before the methods are invoked.DeferringLoadBalancerInterceptor
orDeferringLoadBalancerExchangeFilterFunction
themselves but only pass on references to builders. Therefore their injection points can be declared to be lazy.