This is a question related to:
SockJS receive stomp messages from spring websocket out of order
But I cannot understand how to limit 1 thread in the message broker.
This is a question related to:
SockJS receive stomp messages from spring websocket out of order
But I cannot understand how to limit 1 thread in the message broker.
Maybe define a task-executor with a pool size of 1, and set it as dispatcher for your outbound channel? Can't test it right now but it might work.
Have a look here https://stackoverflow.com/a/16724743/6404321 and here http://docs.spring.io/spring/docs/current/spring-framework-reference/html/websocket.html#websocket-stomp-configuration-performance
You can config another attribute with registration instance.
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void configureClientOutboundChannel(ChannelRegistration registration) {
registration.taskExecutor().maxPoolSize(1);
}
}