Johan Frick
Johan Frick

Reputation: 1124

Spring Websocket with fallback over load balancer

We are trying to use spring-websocket with STOMP using SockJS as a fallback option. We have based our solution on this guide: https://spring.io/guides/gs/messaging-stomp-websocket/.

The environment is running multiple tomcats without sticky session.

The problem we have run into is that it is not possible to use the fallback from websocket due to the xhr requests ending up on separate tomcats where the original session does not exist, causing it to retry with a websocket connection and it will continue in this loop.

Is there a preferred way of solving this issue?

We were hoping that spring-session would be an answer but it does not seem to help in this case.

Upvotes: 4

Views: 1560

Answers (1)

Germann Arlington
Germann Arlington

Reputation: 3353

Your answer is one of:
1) REST services
2) sticky sessions
3) session replication

Upvotes: 1

Related Questions