5

What is the major difference between ZUUL API Gateway Vs Spring Cloud API Gateway? Also what is the replacement of Ribbon what can we use? Can you share sample example which covers

  • Zuul API Gateway,
  • Spring Cloud API Gateway,
  • Load Balancer
PAA
  • 1
  • 46
  • 174
  • 282

1 Answers1

5

Zuul uses blocking APIs , i.e for each request one thread is assigned and that thread will be in use till the reponse is generated . So , the thread will be blocked by the request for the complete lifecycle . Scaling in this case would be achieved by increasing number of threads which will have an upper limit at some point .

I've tried to explain a little in detail here .

Non-blocking APIs can aid in the scaling . one thread will be able to handle multiple requests So , for a reactive application which is a common use case for micro-services , Zuul 2 has been introduced that supports asynchronous pattern and non-blocking apis but its not included in spring cloud eco-system.

Coming to Spring Cloud Gateway , it supports non-blocking apis and long lived connections like web sockets . It will be easier to scale up the application since one thread can accept request and leave it for processing and accept new requests , and return responses as and when they are ready , so not wasting any time being blocked .

Regarding Load balancer, you can check out this article .

devcodes
  • 1,038
  • 19
  • 38