2323
2424import org .w3c .dom .Element ;
2525
26- import org .springframework .beans .factory .config .CustomScopeConfigurer ;
2726import org .springframework .beans .MutablePropertyValues ;
2827import org .springframework .beans .factory .config .BeanDefinition ;
2928import org .springframework .beans .factory .config .ConstructorArgumentValues ;
29+ import org .springframework .beans .factory .config .CustomScopeConfigurer ;
3030import org .springframework .beans .factory .config .RuntimeBeanReference ;
3131import org .springframework .beans .factory .parsing .BeanComponentDefinition ;
3232import org .springframework .beans .factory .parsing .CompositeComponentDefinition ;
4343import org .springframework .messaging .simp .SimpMessagingTemplate ;
4444import org .springframework .messaging .simp .SimpSessionScope ;
4545import org .springframework .messaging .simp .annotation .support .SimpAnnotationMethodMessageHandler ;
46+ import org .springframework .messaging .simp .broker .SimpleBrokerMessageHandler ;
47+ import org .springframework .messaging .simp .stomp .StompBrokerRelayMessageHandler ;
4648import org .springframework .messaging .simp .user .DefaultUserDestinationResolver ;
4749import org .springframework .messaging .simp .user .DefaultUserSessionRegistry ;
48- import org .springframework .messaging .simp .broker .SimpleBrokerMessageHandler ;
4950import org .springframework .messaging .simp .user .UserDestinationMessageHandler ;
50- import org .springframework .messaging .simp .stomp .StompBrokerRelayMessageHandler ;
5151import org .springframework .messaging .support .ExecutorSubscribableChannel ;
5252import org .springframework .scheduling .concurrent .ThreadPoolTaskExecutor ;
5353import org .springframework .util .Assert ;
6161import org .springframework .web .socket .server .support .WebSocketHttpRequestHandler ;
6262import org .springframework .web .socket .sockjs .support .SockJsHttpRequestHandler ;
6363
64-
6564/**
66- * A {@link org.springframework.beans.factory.xml.BeanDefinitionParser}
67- * that provides the configuration for the
68- * {@code <websocket:message-broker/>} XML namespace element.
69- * <p>
70- * Registers a Spring MVC {@link org.springframework.web.servlet.handler.SimpleUrlHandlerMapping}
71- * with order=1 to map HTTP WebSocket handshake requests from STOMP/WebSocket clients.
72- * <p>
73- * Registers the following {@link org.springframework.messaging.MessageChannel}s:
65+ * A {@link org.springframework.beans.factory.xml.BeanDefinitionParser} that provides
66+ * the configuration for the {@code <websocket:message-broker/>} XML namespace element.
67+ *
68+ * <p>Registers a Spring MVC {@link org.springframework.web.servlet.handler.SimpleUrlHandlerMapping}
69+ * with order 1 to map HTTP WebSocket handshake requests from STOMP/WebSocket clients.
70+ *
71+ * <p>Registers the following {@link org.springframework.messaging.MessageChannel}s:
7472 * <ul>
75- * <li>"clientInboundChannel" for receiving messages from clients (e.g. WebSocket clients)
76- * <li>"clientOutboundChannel" for sending messages to clients (e.g. WebSocket clients)
77- * <li>"brokerChannel" for sending messages from within the application to the message broker
73+ * <li>"clientInboundChannel" for receiving messages from clients (e.g. WebSocket clients)
74+ * <li>"clientOutboundChannel" for sending messages to clients (e.g. WebSocket clients)
75+ * <li>"brokerChannel" for sending messages from within the application to the message broker
7876 * </ul>
79- * <p>
80- * Registers one of the following based on the selected message broker options:
77+ *
78+ * <p> Registers one of the following based on the selected message broker options:
8179 * <ul>
82- * <li> a {@link SimpleBrokerMessageHandler} if the <simple-broker/> is used
83- * <li> a {@link StompBrokerRelayMessageHandler} if the <stomp-broker-relay/> is used
80+ * <li>a {@link SimpleBrokerMessageHandler} if the <simple-broker/> is used
81+ * <li>a {@link StompBrokerRelayMessageHandler} if the <stomp-broker-relay/> is used
8482 * </ul>
85- * <p>
86- * Registers a {@link UserDestinationMessageHandler} for handling user destinations.
83+ *
84+ * <p> Registers a {@link UserDestinationMessageHandler} for handling user destinations.
8785 *
8886 * @author Brian Clozel
8987 * @author Rossen Stoyanchev
@@ -95,7 +93,7 @@ class MessageBrokerBeanDefinitionParser implements BeanDefinitionParser {
9593
9694 private static final int DEFAULT_MAPPING_ORDER = 1 ;
9795
98- private static final boolean jackson2Present = ClassUtils .isPresent (
96+ private static final boolean jackson2Present = ClassUtils .isPresent (
9997 "com.fasterxml.jackson.databind.ObjectMapper" , MessageBrokerBeanDefinitionParser .class .getClassLoader ());
10098
10199
@@ -215,6 +213,7 @@ private RootBeanDefinition getDefaultExecutorBeanDefinition(String channelName)
215213 executorDef .getPropertyValues ().add ("corePoolSize" , Runtime .getRuntime ().availableProcessors () * 2 );
216214 executorDef .getPropertyValues ().add ("maxPoolSize" , Integer .MAX_VALUE );
217215 executorDef .getPropertyValues ().add ("queueCapacity" , Integer .MAX_VALUE );
216+ executorDef .getPropertyValues ().add ("allowCoreThreadTimeOut" , true );
218217 return executorDef ;
219218 }
220219
0 commit comments