Configure WebSocket thread pools
This commit is contained in:
parent
bcebf43063
commit
f8c7efabf4
@ -1,6 +1,7 @@
|
|||||||
package lingo.server;
|
package lingo.server;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.messaging.simp.config.ChannelRegistration;
|
||||||
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
|
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
|
||||||
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
|
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
|
||||||
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
|
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
|
||||||
@ -10,6 +11,18 @@ import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
|
|||||||
@EnableWebSocketMessageBroker
|
@EnableWebSocketMessageBroker
|
||||||
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {
|
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
|
@Override
|
||||||
public void configureMessageBroker(MessageBrokerRegistry config) {
|
public void configureMessageBroker(MessageBrokerRegistry config) {
|
||||||
config.enableSimpleBroker("/topic");
|
config.enableSimpleBroker("/topic");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user