Context/Background: A client is connected via web-socket. Server stores WebSocket session and few other identifiers in a Map for later use. Server receives some data from a queue which need to be send to client via web-socket. Using session from Map I am able to send it to the client. So far all good.
This all works fine for single node but not with multiple nodes (no need for clustering), reason being WebSocket session is not Serializable hence the deliemma :(. I was hoping to store the WebSocket Session in a Postgresql database for later use but am struck at Serialization.
What I tried: Someone else asked kind of similar question at non serializable session websocket java ee I tried ried creating a wrapper around Tomcat's Session and provide readObject writeObject but unfortunately WsSession doesn't allow state to be set/read.
Tried using library http://ift.tt/1cLqojO but wasn't successful in Serializing my wrapper for WsSession.
My Environment: JDK 1.8.0_31, Tomcat 8.0.20, Spring 4.1.5.RELEASE, Debian Wheezy.
Thanks for your help.
Aucun commentaire:
Enregistrer un commentaire