0
votes

In our current generation web application we used session replication with tomcat clustering. (and a load balancer) That way, we received an auto failover when a client sends an ajax request to a tomcat node that failed.

In our next generation web application, We would like to have a similar behavior, only with websockets.

So my questions are :

1) Is it possible ?

2) Does it involve websocket-session replication? if so, are there any guides on how to do that?

1
indicate what you mean by websocket-session, is it the native websocket api session?, the JSR-356 javax.websocket.Session?, or the HttpSession object? - Joakim Erdfelt
You know that javax.websocket.Session really cannot be replicated, right? Its equivalent to java.net.Socket in meaning and purpose. - Joakim Erdfelt
So how exactly do i get a cluster of websocket servers ? what happens if one node in the cluster fails? how do the JSR cope with failover?\ - Urbanleg
Reconnect with new javax.websocket.Session - there is no failover - Joakim Erdfelt

1 Answers

1
votes

Websocket implementations that are part of a distributed container may need to migrate websocket sessions from one node to another in the case of a failover. Implementations are required to preserve developer data objects inserted into the websocket session if the data is marked java.io.Serializable. [WSC 2.1.2-4]