Zuul with web socket
Asked Answered
S

3

6

We currently have a direct Websocket connection that goes to a backend webservice from our UI Application. Now when we are trying to do the same through Zuul(ApiGateway) we are not able to connect to backend service We have gone through below issue that does not solve our problem https://github.com/spring-cloud/spring-cloud-netflix/issues/163

but it gives me an alternative in below link https://jmnarloch.wordpress.com/2015/11/11/spring-cloud-sock-js-stomp-zuul-no-websockets/ I am considering it as a last solution.

My other Question is, if we want to use websocket protocol with zuul what changes we need to perform in zuul as I am new to websocket because we know spring support websocket and Zuul is a spring based service (Correct if I am wrong)

UPDATE

This feature wont be available with zuul 2 as of my knowledge. Zuul 2 will not be incorporated into Spring Cloud. See spring cloud gateway for websockets support. check this out(https://github.com/spring-cloud/spring-cloud-netflix/issues/163)

Supercharge answered 13/9, 2016 at 14:34 Comment(3)
you can look here I've configured websocket with zuul through stomp/sockjs protocol. Take a look mainly at gateway and websocket1 applicationsBagdad
Thank you for the link. I will look into it. :)Supercharge
You can use Spring Cloud Gateway. cloud.spring.io/spring-cloud-gateway/single/…Henshaw
D
2

Zuul 1 is unable to support websockets. Zuul 2 will support it https://github.com/Netflix/zuul/issues/112.

Dislocation answered 13/9, 2016 at 15:47 Comment(3)
Hi @spencergibb, Thanks for your reply We have used zuul-core version:2.0.0-r.c.2 which is present in "mvnrepository.com/artifact/com.netflix.zuul/zuul-core" but it is not working for us and there is no release for spring-cloud-starter-zuul for zuul 2 and i am not able to get any roadmap for it and websocket is must for me. Thanks in advanceSupercharge
We won't move to zuul 2 until it is Generally Available, not a pre-release RC2. We could start integration work soon. We have an open issue github.com/spring-cloud/spring-cloud-netflix/issues/163Dislocation
hi @spencergibb, Thanks again we will wait for zuul 2 and will try some work arounds I am facing one more problem with zuul. It is modifying my content type(multipart form-data to text/plain ) header and I am using 1.1.6.Release i know it is fix 1.1.0.M5 but I am still facing this issueSupercharge
C
1

We have created a zuul proxy web socket support feature to resolve this issue. I will be creating a pull request in spring cloud netflix soon. The library and demo are currently hosted in github.

Complicate answered 4/4, 2017 at 11:4 Comment(2)
/@Complicate No LinkGuyenne
@Diyoda_ this one - github.com/mthizo247/spring-cloud-netflix-zuul-websocketOldie
K
0

You can use spring-cloud-starter-gateway instead of zuul. WebSocket is supported and it's a much better developer experience since it's tightly integrated with Spring.

Keats answered 14/9, 2020 at 18:40 Comment(1)
Thanks @panduka, but now we are not depending on spring for routing request and service discovery. Still thanks for updateSupercharge

© 2022 - 2024 — McMap. All rights reserved.