-
Notifications
You must be signed in to change notification settings - Fork 705
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
Allow building @LoadBalanced RestClient in component constructor. #1339
Allow building @LoadBalanced RestClient in component constructor. #1339
Conversation
@Bean | ||
@ConditionalOnMissingBean | ||
public LoadBalancerRequestFactory loadBalancerRequestFactory(LoadBalancerClient loadBalancerClient) { | ||
return new LoadBalancerRequestFactory(loadBalancerClient, transformers); | ||
} | ||
|
||
@Configuration(proxyBeanMethods = false) | ||
@AutoConfiguration | ||
static class DeferringLoadBalancerInterceptorConfig { |
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.
I assume these inner classes get autoconfigured because the outerclass is specified in spring.factories?
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.
Yes; the new annotation is just same as @Configuration(proxyBeanMethods = false)
*/ | ||
@Deprecated(forRemoval = true) | ||
public class LoadBalancerRestClientBuilderBeanPostProcessor implements BeanPostProcessor { |
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.
I was going nuts why this was deprecated and the bean removed when I initially saw this one. I was going in my head with : "is there now a new way to post-process beans? How can a @LoadBalanced be captured without a BeanPostProcessor?"
I was planning to open this defect today, but then saw you actually reverted and fixed :)
I'm really sorry for the mess around that deprecation @wind57. In fact, it was being load-balanced with the previous change, however, with the caveat that a component constructor would be to early to build the |
My point was rather different, I'm sorry for not being verbose enough. Before this PR, I saw that Yes, you did add I hope I make more sense now. And don't worry about the issue at all! |
The |
oh my, I'm an idiot, you're right! I completely missed the |
No worries, it's not very straightforward. |
Load balanced RestClient with deferring postprocessor.