Feign Client端启动一直报找不到生产者的服务实例,后来按照下面的方法解决:
What:
Spring boot feignclient call other instance show below error:
com.netflix.client.ClientException: Load balancer does not have available server for client:
Why:
if eureka.client.fetchRegistry is false, the various shuffle methods in com.netflix.discovery.shared.Applications are not called and hence Applications.shuffleVirtualHostNameMap is never populated. This map is used later for look up in the method Applications.getInstancesByVirtualHostName that then fails.
How:
eureka:
client:
registerWithEureka: true
fetchRegistry: true # change to true, is ok
该参数会主动获取已注册的Eureka服务。
参考链接:
http://blogs.pkstate.com/2017/05/comnetflixclientclientexception-load.html