0

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.

Community
  • 1
  • 1
Tobia
  • 9,165
  • 28
  • 114
  • 219

2 Answers2

0

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

Community
  • 1
  • 1
walen
  • 7,103
  • 2
  • 37
  • 58
0

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);
    }

}
Wachira
  • 340
  • 2
  • 11