Showing posts with label Zuul. Show all posts
Showing posts with label Zuul. Show all posts

Sunday, June 7, 2020

Server side load balancing using Eureka and Zuul

Routing is an important part of a microservice architecture. In real time cloud application, service instances are added/removed dynamically based on requirement and availability in such scenario its very important to manage traffic load. In the following example you will see how to use Zuul API Gateway to enable sever side load balancing of your RESTful Web Services.

Request flow -

1. When service boots up it registers itself with discovery server. Multiple instances register itself with discovery server. Here spring.application.name is use to identify a particular service

2. Zuul gateway also registers itself with discovery server. Remember Zuul gateway is also a discovery client

3. When client sends request to zuul gateway for a particular service, Zuul gateway queries discovery server to fetch available healthy instance of the service and then accordingly send request to that service.

Please check previous example on Discovery Server.

Discovery code -