Spring Boot Stomp WebSocket

后端 未结 2 767
無奈伤痛
無奈伤痛 2021-01-03 06:20

I seem to be running into an issue bumping up against the 8k size limit that embedded tomcat has for stomp websocket messages.

When sending a message from server to

相关标签:
2条回答
  • 2021-01-03 06:46

    You can change max text buffer size according to your needs:

    WebSocketContainer container = ContainerProvider.getWebSocketContainer();
    container.setDefaultMaxTextMessageBufferSize(MAX_TEXT_MESSAGE_BUFFER_SIZE);
    WebSocketClient wsClient = new StandardWebSocketClient(container);
    
    0 讨论(0)
  • 2021-01-03 07:12

    After banging my head against the wall for a week, I discovered the problem. The client I was using (internal spring java websocket stomp client) is not capable of partial messaging nor is it configurable with the size of buffer for messages. The answer(workaround) was to take the internal java stop client code and implement my own version of it that had a configurable message buffer size as well as implement a way to handle partial messages. Hope this anyone else who hits this problem.

    0 讨论(0)
提交回复
热议问题