-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve STOMP WebSocket documentation for input message buffer size #31616
Comments
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 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.
The text was updated successfully, but these errors were encountered: