您好,登錄后才能下訂單哦!
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})
為什么會這樣,我還沒搞明白,先記錄下.
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。