SpringCloud Feign consumption Eureka service reported an error
SpringCloud Feign consumption Eureka Service report com.netflix.client.ClientException: Load balancer does not have available server for client: user
With regard to this mistake, I searched a lot on the Internet, and I threw out the problems I encountered.
I put the call to the external system in a child model of client, using packet scanning.
Feign com.netflix.client.ClientException: Load balancer does not have available server for client: user appears
@ SpringBootApplication (exclude = {DataSourceAutoConfiguration.class}) @ ComponentScan (basePackages = "com.XXX") @ Slf4j@Configuration@EnableScheduling@EnableTransactionManagement@EnableEurekaClient@EnableFeignClients (basePackages = "com.XXX.client")
Then change it to this class scanning mode and run and call 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})
Why is this happening? I haven't figured it out yet. Write it down first.