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})
为什么会这样,我还没搞明白,先记录下.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。