We're moving away from the spring-cloud Netflix OSS ecosystem one step at a time. Currently we're implementing spring-cloud-loadbalancer and removing Ribbon. However we used to have a lot of static services in our integration tests, now with the move from ribbon towards spring-cloud-loadbalancer those properties are not being picked up any longer. i.e.:
foo-service.ribbon.NIWSServerListClassName=com.netflix.loadbalancer.ConfigurationBasedServerList
foo-service.ribbon.listOfServers=localhost:9876
We've migrated towards using spring-cloud-loadbalancer in the following way
First we annotated our Webclient.Builder with @LoadBalanced like this
@Bean
@LoadBalanced
fun webClientBuilder() = WebClient.builder()
And then we've added the @LoadBalancerClient annotation on the client classes like this
@LoadBalancerClient(name = "foo-service", configuration = [FooServiceConfiguration::class])
class FooServiceClient(private val basicAuthWebClient: WebClient)
This results in our tests failing with an UnknownHostException for foo-service.
Now My question is how do we configure this static server list in the new spring-cloud-loadbalancer?
spring.cloud.discovery.client.simple.*
properties. See cloud.spring.io/spring-cloud-static/spring-cloud-commons/… – Steadyspring.cloud.discovery.client.simple
instead of theNIWSServerListClassName
? – CorduroysNIWSServerListClassName
wont work with spring cloud – Corduroys