SpringCloud Feign消费Eureka服务报com.netflix.client.ClientException: Load balancer does not have available server for client: user
创新互联公司坚持“要么做到,要么别承诺”的工作理念,服务领域包括:网站设计、网站制作、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的新建网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!
关于这个错误,网上一搜一大把,我抛出我遇到的问题
我把调用外部系统放在一个 client 的子model里头,用包扫描的方式
出现 Feign com.netflix.client.ClientException: Load balancer does not have available server for client: user
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) @ComponentScan(basePackages = "com.XXX") @Slf4j @Configuration @EnableScheduling @EnableTransactionManagement @EnableEurekaClient @EnableFeignClients(basePackages = "com.XXX.client")
然后改成这种class扫描方式,运行调用OK
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) @ComponentScan(basePackages = "com.XXX") @Slf4j @Configuration @EnableScheduling @EnableTransactionManagement @EnableEurekaClient @EnableFeignClients(basePackageClasses = {com.XXX.client.base.AccountClient.class, com.XXX.client.base.ExchangeOtcClient.class, com.XXX.client.mkt.MktClient.class})
为什么会这样,我还没搞明白,先记录下.