Spring-cloud with Feign / Ribbon / Eureka - Unable to locate service instances

My bridging client is currently unable to discover service instances using Eureka. My config includes the following annotations:

@Configuration
@ComponentScan
@EnableAutoConfiguration
@EnableDiscoveryClient
@FeignClientScan

      

I have included the following dependencies (spring-cloud 1.0.0-BUILD-SNAPSHOT):

org.springframework.cloud:spring-cloud-starter-eureka
com.netflix.feign:feign-core
com.netflix.feign:feign-ribbon

      

As far as I can tell, the feign client uses ConfigurationBasedServerList

and therefore requires the addresses of the available service instances to be explicitly specified in the config file (property ribbon.serverList

).

However, everything works fine if I explicitly state:

ribbon.NIWSServerListClassName: com.netflix.niws.loadbalancer.DiscoveryEnabledNIWSServerList

      

My test application also uses a Spring client based on a RestTemplate that is automatically configured to use the Eureka Ribbon implementation. The weird thing is that the Feign client works fine (i.e. finds service instances) if the RestTemplate is started first. It looks like the RestTemplate setting is doing some (static) initialization somewhere that benefits the feign client.

Am I missing something on how to set up Feig support?

+3
spring-cloud netflix-feign


source to share


No one has answered this question yet

Check out similar questions:

nine
Spring cloud: tape and HTTPS
7
Eureka Fign client fake for Unittesting
7
spring-cloud with ribbon / eureka / hystrix using restTemplate unable to set connect / read timeouts
3
Spring Cloud: How To Use Feign Without Ribbon
3
spring-cloud with RestTemplate // Ribbon / Eureka - try again when server is down
2
Spring cloud (Brixton RC2) eureka + simulation or setting of rest pattern not working
2
Spring cloud: tape and HTTPS WITHOUT Eureka
1
Redirecting feign & ribbon logs to log4j2
1
Spring Cloud Netflix Don't Take A Job
0
Are Eureka tape recordings included in the tape?



All Articles
Loading...
X
Show
Funny
Dev
Pics