Spring Websocket in a tomcat cluster

前端 未结 3 1906
悲哀的现实
悲哀的现实 2020-12-12 21:18

In our current application, we use Spring Websockets over STOMP. We are looking to scale horizontally. Are there any best practices on how we should handle websocket traffic

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-12 21:36

    Maintain session info across multiple nodes:

    Suppose we have 2 server host, backed up with load balancer.

    Websockets are socket connection from browser to specific server host.eg host1

    Now if host1 goes down, socket connection from load balancer - host 1 will break. How spring will reopen same websocket connection from load balancer to host 2 ? browser should not open new websocket connection

提交回复
热议问题