Search code examples
netflix-zuul

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


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!


Solution

  • 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...