Configure WebSocket thread pools
This commit is contained in:
parent
bcebf43063
commit
f8c7efabf4
@ -1,6 +1,7 @@
|
||||
package lingo.server;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.messaging.simp.config.ChannelRegistration;
|
||||
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
|
||||
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
|
||||
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
|
||||
@ -10,6 +11,18 @@ import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
|
||||
@EnableWebSocketMessageBroker
|
||||
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
|
||||
|
||||
@Override
|
||||
public void configureClientInboundChannel(ChannelRegistration registration) {
|
||||
// Single thread unless/until more threads are needed
|
||||
registration.taskExecutor().corePoolSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureClientOutboundChannel(ChannelRegistration registration) {
|
||||
// Single thread unless/until more threads are needed
|
||||
registration.taskExecutor().corePoolSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureMessageBroker(MessageBrokerRegistry config) {
|
||||
config.enableSimpleBroker("/topic");
|
||||
|
Loading…
x
Reference in New Issue
Block a user