Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

335
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!