My feign client currently fails to discover service instances using Eureka. My configuration includes the following annotations:
@Configuration
@ComponentScan
@EnableAutoConfiguration
@EnableDiscoveryClient
@FeignClientScan
I 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 makes use of a ConfigurationBasedServerList
and therefore requires the addresses of the available service instances to be explicitly specified in the configuration file (ribbon.serverList
property).
However, everything is working fine if I explicitly specify:
ribbon.NIWSServerListClassName: com.netflix.niws.loadbalancer.DiscoveryEnabledNIWSServerList
My test application also makes use of a Spring RestTemplate based client automatically configured to make use of an Eureka-enabled Ribbon implementation. Strange thing is that the Feign client is working fine (i.e. finds service instances) if the RestTemplate is invoked first. Looks like the RestTemplate setup performs some (static) initialisations somewhere that then benefit to the feign client.
Do I miss something in how Feign support should be configured?