这是一个与以下问题相关的问题:
{{3}}
但我无法理解如何限制消息代理中的1个线程。
答案 0 :(得分:0)
也许定义一个池大小为1的任务执行器,并将其设置为出站通道的调度程序?现在无法测试它,但它可能会有效。
在这里查看https://stackoverflow.com/a/16724743/6404321和http://docs.spring.io/spring/docs/current/spring-framework-reference/html/websocket.html#websocket-stomp-configuration-performance
答案 1 :(得分:0)
您可以使用注册实例配置另一个属性。
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void configureClientOutboundChannel(ChannelRegistration registration) {
registration.taskExecutor().maxPoolSize(1);
}
}