Closed monkeycode0 closed 12 months ago
I've edited your comment to improve the formatting. You might want to check out this Mastering Markdown guide for future reference.
I've edited your comment to improve the formatting. You might want to check out this Mastering Markdown guide for future reference.
Thank you very much!
Thanks for the report.
The above should adjust the input buffer size of a standard (JSR-356) WebSocket server. Separately, there is a size limit for incoming messages at the STOMP level that you can set through the configureWebSocketTransport
callback of WebSocketMessageBrokerConfigurer
. If you turn logging up, you'll look for indications whether the message is rejected at the WebSocket server or at the level of STOMP handling.
If this does not work, please share a small project.
Thanks for the report.
The above should adjust the input buffer size of a standard (JSR-356) WebSocket server. Separately, there is a size limit for incoming messages at the STOMP level that you can set through the
configureWebSocketTransport
callback ofWebSocketMessageBrokerConfigurer
. If you turn logging up, you'll look for indications whether the message is rejected at the WebSocket server or at the level of STOMP handling.If this does not work, please share a small project.
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.enableSimpleBroker("/topic", "/direct");
config.setApplicationDestinationPrefixes("/app");
}
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/manager/{userId}", "/client/{userId}")
.setAllowedOrigins("*")
.setHandshakeHandler(new CustomHandshakeHandler())
;
}
@Override
public void configureWebSocketTransport(WebSocketTransportRegistration registry) {
registry.setMessageSizeLimit(128 * 1024 * 1024);
registry.setSendBufferSizeLimit(128 * 1024 * 1024);
registry.setSendTimeLimit(60 * 1000);
WebSocketMessageBrokerConfigurer.super.configureWebSocketTransport(registry);
}
}
yes, you are right! i override this method configureWebSocketTransport ,id does work!
when i use the gateway, it also should configure this:
spring:
cloud:
gateway:
httpclient:
websocket:
max-frame-payload-length: 5242880
Good that it's working. I think the STOMP WebSocket Server section of the documentation could be improved a little based on this. Also the Server Configuration under WebSockets could also mention that with STOMP there is additional transport config.
I send a message to the server from a web UI.
When the data size is greater than 64K, the server does not respond to the WEB client.
How can I change the max buffer size?
I'd like to use this config, but it does not work.