-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: messagingIssues in messaging modules (jms, messaging)Issues in messaging modules (jms, messaging)type: enhancementA general enhancementA general enhancement
Milestone
Description
Affects: 5.2.8.RELEASE
@Configuration
@EnableWebSocketMessageBroker
public class MyConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void configureMessageBroker(MessageBrokerRegistry registry) {
// ...
registry.setPreservePublishOrder(true);
}
@Override
public void configureWebSocketTransport(WebSocketTransportRegistration registry) {
registry.setSendBufferSizeLimit(512 * 1024);
}
}
The setSendBufferSizeLimit method has no more effect after setPreservePublishOrder(true).
The reason is that the instance of OrderedMessageSender keeps all messages and sends only one message at a time to the buffer.
Thus, the application can slow down significantly or even crash with OutOfMemory Error instead of just closing the WebSocket connection when the messages queue overflow.
Memory Analyzer shows how OrderedMessageSender can occupy the whole heap:
Metadata
Metadata
Assignees
Labels
in: messagingIssues in messaging modules (jms, messaging)Issues in messaging modules (jms, messaging)type: enhancementA general enhancementA general enhancement