Using SockJS java client, I am trying to connect to Spring sockjs server and is getting error 1009 for messages (without headers) of ~20Kb. Javascript library works fine.
If you're doing it like this:
SockJsClient sockJsClient = new SockJsClient(transports);
WebSocketStompClient stompClient = new WebSocketStompClient(sockJsClient);
Try:
stompClient.setInboundMessageSizeLimit(your_message_size_limit);
I stumbled with the same problem. It's all about the configuration of the client, not the server. You can create WebSocketContainer instance and configure it.
WebSocketContainer container = ContainerProvider.getWebSocketContainer();
container.setDefaultMaxBinaryMessageBufferSize(your_size);
container.setDefaultMaxTextMessageBufferSize(your_size);
WebSocketClient transport = new StandardWebSocketClient(container);
WebSocketStompClient stompClient = new WebSocketStompClient(transport);
your_size - size in bytes.