Somasundaram Sekar
Somasundaram Sekar

Reputation: 5524

Springboot: Ribbon and Zuul

Do we need to configure both Ribbon and Zuul for Loadbalancing the microservices.

From what I have seen Zuul is more of a conventional reverse-proxy loadbalancer and any request to services thro Zuul will automatically be loadbalanced and I do not have to configure Ribbon in individual microservices.

We will need Ribbon configured in the service only if we need to connect to a service that is not proxied by Zuul.

Is the understanding correct.

Upvotes: 1

Views: 429

Answers (1)

pan
pan

Reputation: 1967

If you are using eureka for discovering your services, that are balanced through zuul, you don't need to configure ribbon in any way.

Say, you have a ServiceA that is discovered by eureka and you have a zuul route configured like this one

 zuul:
   routes:
     example:
       path: /example/**
       serviceId: ServiceA

As soon as you have more than one instance of ServiceA running, zuul will start to load balance the load of all ServiceA with a round robin algorithm.

Upvotes: 2

Related Questions