-
Notifications
You must be signed in to change notification settings - Fork 719
Adds config per load balancer client. #1028
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
Conversation
Client specific configuration goes under `spring.cloud.loadbalancer.clients.<serviceId>.*`. Defaults are set using `spring.cloud.loadbalancer.*`. Fixes gh-914
Adds LoadBalancerDefaultMappingsProviderAutoConfiguration to supply the loadbalancer defaults mapping to DefaultsBindHandlerAdvisor
...mmons/src/main/java/org/springframework/cloud/commons/config/DefaultsBindHandlerAdvisor.java
Show resolved
Hide resolved
OlgaMaciaszek
left a comment
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.
This all looks very good and solves the default fallback issue. I'm only wandering about if we could also somehow rewrite the places where we use @ConditionalOnProperty (like here) to enable per-client config. wdyt?
| Map<ConfigurationPropertyName, ConfigurationPropertyName> mappings = new HashMap<>(); | ||
| mappings.put(ConfigurationPropertyName.of("spring.cloud.loadbalancer.clients"), | ||
| ConfigurationPropertyName.of("spring.cloud.loadbalancer")); | ||
| return mappings; |
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.
👍 Looks like that's what we were missing in the previous considerations for this issue.
| public class LoadBalancerDefaultMappingsProviderAutoConfiguration { | ||
|
|
||
| @Bean | ||
| public DefaultsBindHandlerAdvisor.MappingsProvider rabbitExtendedPropertiesDefaultMappingsProvider() { |
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.
Remove rabbit from method name?
|
yes, anything in LoadBalancerClientConfiguration's will need a custom |
LoadBalancerClientsProperties now extends LoadBalancerProperties. The `clients` attribute is now a field. The `@ConfigurationProperties("spring.cloud.loadbalancer")` has moved from LoadBalancerProperties to LoadBalancerClientsProperties
|
Thank you! That was a long-awaited feature ❤️ |
Client specific configuration goes under
spring.cloud.loadbalancer.clients.<serviceId>.*. Defaults are set usingspring.cloud.loadbalancer.*.Fixes gh-914