Fix issue with default executor for message channels
This change ensures correct default settings for message channel's created through the websocket message-broker XML namespace even when the channels are customized for other reasons -- e.g. to add a channel interceptor. Issue: SPR-11623
This commit is contained in:
@@ -293,6 +293,17 @@ public class MessageBrokerBeanDefinitionParserTests {
|
||||
testExecutor("brokerChannel", 102, 202, 602);
|
||||
}
|
||||
|
||||
// SPR-11623
|
||||
|
||||
@Test
|
||||
public void customChannelsWithDefaultExecutor() {
|
||||
loadBeanDefinitions("websocket-config-broker-customchannels-default-executor.xml");
|
||||
|
||||
testExecutor("clientInboundChannel", Runtime.getRuntime().availableProcessors() * 2, Integer.MAX_VALUE, 60);
|
||||
testExecutor("clientOutboundChannel", Runtime.getRuntime().availableProcessors() * 2, Integer.MAX_VALUE, 60);
|
||||
assertFalse(this.appContext.containsBean("brokerChannelExecutor"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void messageConverters() {
|
||||
loadBeanDefinitions("websocket-config-broker-converters.xml");
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:websocket="http://www.springframework.org/schema/websocket"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/websocket http://www.springframework.org/schema/websocket/spring-websocket-4.0.xsd">
|
||||
|
||||
<websocket:message-broker>
|
||||
<websocket:stomp-endpoint path="/foo"/>
|
||||
<websocket:simple-broker prefix="/topic"/>
|
||||
<websocket:client-inbound-channel>
|
||||
<websocket:interceptors>
|
||||
<ref bean="myInterceptor"/>
|
||||
</websocket:interceptors>
|
||||
</websocket:client-inbound-channel>
|
||||
<websocket:client-outbound-channel>
|
||||
<websocket:interceptors>
|
||||
<ref bean="myInterceptor"/>
|
||||
</websocket:interceptors>
|
||||
</websocket:client-outbound-channel>
|
||||
<websocket:broker-channel>
|
||||
<websocket:interceptors>
|
||||
<ref bean="myInterceptor"/>
|
||||
</websocket:interceptors>
|
||||
</websocket:broker-channel>
|
||||
</websocket:message-broker>
|
||||
|
||||
<bean id="myInterceptor" class="org.springframework.web.socket.config.TestChannelInterceptor"/>
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user