Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to migrate netflix zuul 1 to zuul 2 or spring cloud gateway

Tags:

netflix-zuul

Our services are currently using spring cloud netflix zuul as our gateway.

Now we have to support websocket so we need to migrate zuul 1 to zuul 2 or spring cloud gateway.

I know spring cloud team is no more supporting zuul as they have their own spring cloud gateway.

I briefly looked into zuul 2.0 and I got to know that we should change filter things first

and there is no more @EnableZuulProxy. (How about Routes configration in application.yml?)

So My question is, is there an reference or simple document to migrate zuul 1.0 to 2.0?

Or we have to rebuild our gateway application?

Any help would be appreciated!

like image 745
DKWoo Avatar asked Apr 07 '20 14:04

DKWoo


People also ask

What is the difference between Zuul and spring cloud gateway?

Zuul is built on servlet 2.5 (works with 3. x), using blocking APIs. It doesn't support any long lived connections, like websockets. Gateway is built on Spring Framework 5, Project Reactor and Spring Boot 2 using non-blocking APIs.

What is the replacement of Zuul?

Apigee, Eureka, Kong, HAProxy, and Istio are the most popular alternatives and competitors to Zuul.

Is Netflix still using Zuul?

The new version of the Zuul gateway is built on top of the Netty server, and includes some improvements and new features. You can read more about them on the Netflix blog. Despite this decision being made by the Netflix cloud team, the Spring Cloud team has abandoned development of the Zuul module.


1 Answers

I am looking into this right now myself, probably going to migrate to Spring Cloud Gateway as we're using Spring a lot already. One major thing to watch out for is that both Spring Cloud Gateway and Zuul 2 are using a reactive programming model, with only a couple of threads handling all the requests, which means that if you have any custom code that calls http endpoints or other services, you will have to re-code those pieces in a reactive fashion, or else your threads will block and your gateway won't be able to handle more than a couple requests at a time.

You can read a bit about Spring Webflux (used in Spring Cloud Gateway instead of Spring MVC) and reactive programming here: https://docs.spring.io/spring-framework/docs/current/reference/html/web-reactive.html

And no, I have not found a document that will guide you through a migration. In fact that's how I googled to this StackOverflow question...

like image 169
Michael Avatar answered Oct 14 '22 23:10

Michael