I'm using ribbon and eureka and I want add the following property:
my-service.ribbon.ServerListRefreshInterval
However, the default context doesn't see this property. I'm using ribbon as a loadBalancer. Currently I fixed it by using:
ConfigurationManager.loadPropertiesFromResources("my-service.properties");
Is this the only way to fix this?
Example of my code:
@Component
public class ServiceClientFactory
{
@Inject
public ServiceClientFactory(
private String applicationName="firstApp";
final SpanAccessor spanAccessor
final LoadBalancerClient loadBalancer,
) throws IOException {
loadBalancer.choose(applicationName);
}
}
@SpringBootApplication
@EnableEurekaClient
public class ServiceApplication extends SpringBootServletInitializer {
public static void main(String[] args) {
new ServiceApplication()
.configure(new SpringApplicationBuilder(ServiceApplication.class))
.run(args);
}
}