We are using websockets with apache-tomcat (8.0.15). The tomcat runs behind a HAProxy which has a timeout server 60s
. We are using spring-websocket (4.1.4.RELEASE). Problem we are facing is that the sessions keep getting closed very frequently.
We tried a ping-pong between websocket client and server, where in the websocket client sends a (ping) message every 30 secs:
["SEND\ncallback_id:1449064876903\ndestination:/app/data/ping\ncontent-length:2\n\n{}\u0000"]
and the server responds with a pong:
a["MESSAGE\ndestination:/user/topic\ncontent-type:application/json;charset=UTF-8\nsubscription:sub-1\nmessage-id:vkgme6t7-33577\ncontent-length:68\n\n{\"message\":\"pong\"}\u0000"]
Still, we are seeing getting below logs very often:
[SubProtocolWebSocketHandler] - No messages received after 60215 ms. Closing XhrStreamingSockJsSession[id=xxxx].
Any ideas what is wrong?