I have a websocket - stomp client application in java. It is working as expected, but when I send a message which is about 16k bytes or greater. It is throwing ConnectionLostException
. I checked with a javascript client. In javascript the client sends and receives data in chunks of around 16k bytes and it works fine even if the size increases to 100kbytes. I have checked for size limits in stomp documentation and it is by default ~65kb. What can be the reason for such a scenario because manually chunking the data is a complicated task and will take time. Any advice would be appreciated.
Stack trace is
org.springframework.messaging.simp.stomp.ConnectionLostException: Connection closed
11:48:31.001 [WebSocketClient-AsyncIO-1] ERROR com.demo.webSocket.lib.usage.ExampleClientLib - Connection Closed
at org.springframework.messaging.simp.stomp.DefaultStompSession.afterConnectionClosed(DefaultStompSession.java:487)
at org.springframework.web.socket.messaging.WebSocketStompClient$WebSocketTcpConnectionHandlerAdapter.afterConnectionClosed(WebSocketStompClient.java:354)
at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.onClose(StandardWebSocketHandlerAdapter.java:141)
at org.apache.tomcat.websocket.WsSession.fireEndpointOnClose(WsSession.java:535)
at org.apache.tomcat.websocket.WsSession.onClose(WsSession.java:513)
at org.apache.tomcat.websocket.WsFrameBase.processDataControl(WsFrameBase.java:341)
at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:283)
at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:127)
at org.apache.tomcat.websocket.WsFrameClient.processSocketRead(WsFrameClient.java:78)
at org.apache.tomcat.websocket.WsFrameClient.access$300(WsFrameClient.java:31)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:133)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:117)
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
at sun.nio.ch.Invoker$2.run(Invoker.java:218)
at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)