File tree 2 files changed +18
-3
lines changed
main/java/org/springframework/jms/config
test/java/org/springframework/jms/config
2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2015 the original author or authors.
2
+ * Copyright 2002-2018 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -200,8 +200,8 @@ public C createListenerContainer(JmsListenerEndpoint endpoint) {
200
200
instance .setAutoStartup (this .autoStartup );
201
201
}
202
202
203
- endpoint .setupListenerContainer (instance );
204
203
initializeContainer (instance );
204
+ endpoint .setupListenerContainer (instance );
205
205
206
206
return instance ;
207
207
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2015 the original author or authors.
2
+ * Copyright 2002-2018 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -149,6 +149,21 @@ public void backOffOverridesRecoveryInterval() {
149
149
assertSame (backOff , new DirectFieldAccessor (container ).getPropertyValue ("backOff" ));
150
150
}
151
151
152
+ @ Test
153
+ public void endpointConcurrencyTakesPrecedence () {
154
+ DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory ();
155
+ factory .setConcurrency ("2-10" );
156
+
157
+ SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint ();
158
+ MessageListener messageListener = new MessageListenerAdapter ();
159
+ endpoint .setMessageListener (messageListener );
160
+ endpoint .setDestination ("myQueue" );
161
+ endpoint .setConcurrency ("4-6" );
162
+ DefaultMessageListenerContainer container = factory .createListenerContainer (endpoint );
163
+ assertEquals (4 , container .getConcurrentConsumers ());
164
+ assertEquals (6 , container .getMaxConcurrentConsumers ());
165
+ }
166
+
152
167
153
168
private void setDefaultJmsConfig (AbstractJmsListenerContainerFactory <?> factory ) {
154
169
factory .setConnectionFactory (connectionFactory );
You can’t perform that action at this time.
0 commit comments