I found a very similar example in Moises Macero's book: Learn Microservices with Spring Boot, A Practical Approach to RESTful... e.g:
public class RibbonConfiguration {
@Bean
public IPing ribbonPing(IClientConfig config) {
return new PingUrl(false, "/health");
}
@Bean
public IRule ribbonRule(IClientConfig config) {
return new AvailabilityFilteringRule();
}}
The scope of this configuration is changing the default Ribbon load balancing strategy.While
Moreover in the official documentation I found this:
@Configuration
class DefaultRibbonConfig {
@Bean
public IRule ribbonRule() {
return new BestAvailableRule();
}
@Bean
public IPing ribbonPing() {
return new PingUrl();
}
@Bean
public ServerList<Server> ribbonServerList(IClientConfig config) {
return new RibbonClientDefaultConfigurationTestsConfig.BazServiceList(config);
}
@Bean
public ServerListSubsetFilter serverListFilter() {
ServerListSubsetFilter filter = new ServerListSubsetFilter();
return filter;
}
}
As you can see, the first two methods are without IClientConfig parameter, here official docs:
Customizing the Default for All Ribbon Clients
So I came back to my config file and I removed IClientConfig parmeter and the program still works.
In my opinion IClientConfig is useless in this moment.
But you can refer to IClientConfig author's comment: IClientConfig
Defines the client configuration used by various APIs to initialize clients or load balancers
and for method execution.