Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

336
Vistas
Netflix Ribbon with Spring Adding Multiple Clients

My application connects with multiple REST APIs.

I've been successful in adding a Ribbon Client/Load Balance to my application for one of those APIs with its own list of servers

Now I'd like to add a second client that would hold the server list for my second API.

In order to define my client name which is used by Archaius to load specific properties, I added the following property.

ribbon.client.name=myFirstClientName

My question is: How do I define another client on the same application?

I thought it would be a comma-separated list like:

ribbon.client.name=myFirstClientName,mySecondClientName

However, this didn't work.

Eventually, I want to end up with two lists of servers like

myFirstClientName.ribbon.listOfServers=<ip>,<ip>
mySecondClientName.ribbon.listOfServers=<ip>,<ip>

Any thoughts?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I was able to make it work by adding a @RibbonClient annotation on the interfaces I created for Feign.

The resulting class would be

@FeignClient("http://myFirstClientName/")
@RibbonClient(value = "myFirstClientName", configuration = MyFirstClientConfig.class)
public interface MyFirstFeignService {

Second Client would be:

@FeignClient("http://mySecondClientName/")
@RibbonClient(value = "mySecondClientName", configuration = MySecondClientConfig.class)
public interface MySecondFeignService {

Then of course I would set my two lists of server ips

myFirstClientName.ribbon.listOfServers=<ip>,<ip>
mySecondClientName.ribbon.listOfServers=<ip>,<ip>

PS: Make sure your config classes - MySecondClientConfig and MyFirstClientConfig - above are NOT on the ApplicationContext. Don't let it be caught by some @ComponentScan somewhere or else it won't work.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda