“ com.netflix.client.ClientException:负载平衡器没有适用于客户端的服务器:外汇服务”

时间:2020-03-06 11:07:01

标签: spring-boot microservices netflix-eureka netflix-ribbon

我是微服务的新手,只是尝试创建两个微服务并将其注册到eureka。我收到以下异常:

"com.netflix.client.ClientException: Load balancer does not have available server for client: forex-service".  Below is my configuration.

eureka命名服务器类:

@SpringBootApplication @EnableEurekaServer public class MicroserviceEurekaNamingServerApplication {}

application.properties

spring.application.name=netflix-eureka-naming-server server.port=8761 eureka.client.register-with-eureka=false eureka.client.fetch-registry=false

外汇服务类别:

@SpringBootApplication @EnableDiscoveryClient @EnableEurekaClient public class Forex2Microservice2Application {}

application.properties

spring.application.name=forex-service spring.jpa.show-sql=true spring.h2.console.enabled=true eureka.client.service-url.default-zone=http://localhost:8761/eureka

货币服务类别:

@SpringBootApplication @EnableFeignClients @EnableDiscoveryClient @EnableEurekaClient public class SpringBootMicroserviceCurrencyConversionApplication {}

application.properties

spring.application.name=currency-conversion-service server.port=8100 eureka.client.service-url.default-zone=http://localhost:8761/eureka

假冒客户

@FeignClient(name = "forex-service") @RibbonClient(name = "forex-service") public interface CurrencyExchangeServiceProxy {}

谢谢。

0 个答案:

没有答案