如何配置 Feign 客户端在没有 Consul 的情况下工作
How to configure Feign client to work without Consul
有人可以帮助找出为什么我无法使用 application.properties
且没有 运行 consul 在本地 FeignClient
进行设置吗?
客户:
@FeignClient(value = "my-service", configuration = FeignConfig.class) {
...
}
application.properties:
spring.cloud.consul.config.enabled=false
my-service.ribbon.listOfServers=127.0.0.1:8091
设法配置 @FeignClient
也使用硬编码地址,使用 aplication.properties
中的这些配置:
<service-name>.ribbon.listOfServers=<ip:port>
spring.cloud.bus.enabled=false
spring.cloud.consul.discovery.enabled=false
spring.cloud.consul.enabled=false
有人可以帮助找出为什么我无法使用 application.properties
且没有 运行 consul 在本地 FeignClient
进行设置吗?
客户:
@FeignClient(value = "my-service", configuration = FeignConfig.class) {
...
}
application.properties:
spring.cloud.consul.config.enabled=false
my-service.ribbon.listOfServers=127.0.0.1:8091
设法配置 @FeignClient
也使用硬编码地址,使用 aplication.properties
中的这些配置:
<service-name>.ribbon.listOfServers=<ip:port>
spring.cloud.bus.enabled=false
spring.cloud.consul.discovery.enabled=false
spring.cloud.consul.enabled=false