Netflix / ribbon

Ribbon is a Inter Process Communication (remote procedure calls) library with built in software load balancers. The primary usage model involves REST calls with various serialization scheme support.
Apache License 2.0
4.54k stars 1.24k forks source link

How to configure listOfServers for foo-service? #390

Open octopus-prime opened 5 years ago

octopus-prime commented 5 years ago

Without hyphen in service-id the configuration works well. But with hyphen in service-id the configuration does not find the service-id.

bootstrap.yml:

foo-service:
  ribbon:
    listOfServers: http://localhost:9999

error:

Caused by: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'foo-service.FeignClientSpecification' defined in null

So, how to configure listOfServers for foo-service?

Ravis22 commented 5 years ago

I have services with hyphen e.g user-service name with which it is registered on discovery server. I am using properties file instead of yml but this should not make any difference. user-service.ribbon.listOfServers=http://localhost:9999

hart-james commented 3 years ago

Straight out of the Spring.io/guides for Ribbon. To hardcode them:

Service-name:
  ribbon:
    eureka:
      enabled: false
    listOfServers: localhost:8090,localhost:9092,localhost:9999