Could not understand the different parameters in the stomp over websocket config I am using for developing a chat application that involves images/vidoes:
I notice that the SockJs in webpage, sends message with a frame size of 16K. I also tested that the message size limit is what determines the max size of message that I can transfer.
Could you please let me know what is:
stream bytes limit
send buffer size limit
http message cache size
What is partial messages and how to use them and are they useful here?
Also I plan on setting the max size of image/video to 2GB and expects about 100 simultaneous users when I release.
Could you please let us know what sizes should I keep and why? What are the defaults? And how each of them would affect the performance of my chat application?
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/stomp").withSockJS()
.setStreamBytesLimit(15 * 1024)
.setHttpMessageCacheSize(15 * 1024);
}
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
registry.enableSimpleBroker("/queue/", "/topic/", "/exchange/");
registry.setApplicationDestinationPrefixes("/app");
}
@Override
public void configureWebSocketTransport(WebSocketTransportRegistration registration) {
registration.setSendTimeLimit(15 * 1000)
.setSendBufferSizeLimit(1 * 1024)
// max message size 2GB (2048 bytes) : default is 64KB
.setMessageSizeLimit(2 * 1024 * 1024);
}
}