Fix issue with default executor for broker channel

The default for the broker channel should be "no executor".

Issue: SPR-11623
This commit is contained in:
Rossen Stoyanchev
2014-04-01 11:16:13 -04:00
parent fb7d81c4a2
commit 6ec3de6029
3 changed files with 34 additions and 23 deletions

View File

@@ -298,8 +298,10 @@ public class MessageBrokerBeanDefinitionParserTests {
@Test
public void customChannelsWithDefaultExecutor() {
loadBeanDefinitions("websocket-config-broker-customchannels-default-executor.xml");
List<Class<? extends MessageHandler>> subscriberTypes = Arrays.<Class<? extends MessageHandler>>asList(SubProtocolWebSocketHandler.class);
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

View File

@@ -1,16 +1,14 @@
<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
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,/bar">
<websocket:handshake-handler ref="myHandler"/>
</websocket:stomp-endpoint>
<websocket:stomp-endpoint path="/foo"/>
<websocket:simple-broker prefix="/topic"/>
<websocket:client-inbound-channel>
<websocket:executor core-pool-size="100" max-pool-size="200" keep-alive-seconds="600"/>
<websocket:interceptors>
<ref bean="myInterceptor"/>
</websocket:interceptors>
@@ -18,13 +16,15 @@
<websocket:client-outbound-channel>
<websocket:interceptors>
<ref bean="myInterceptor"/>
<bean class="org.springframework.web.socket.config.TestChannelInterceptor"/>
</websocket:interceptors>
</websocket:client-outbound-channel>
<websocket:broker-channel>
<websocket:interceptors>
<ref bean="myInterceptor"/>
</websocket:interceptors>
</websocket:broker-channel>
</websocket:message-broker>
<bean id="myHandler" class="org.springframework.web.socket.config.TestHandshakeHandler"/>
<bean id="myInterceptor" class="org.springframework.web.socket.config.TestChannelInterceptor"/>
</beans>