File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
main/java/org/springframework/jms/config
test/java/org/springframework/jms/config Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2015 the original author or authors.
2+ * Copyright 2002-2018 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -200,8 +200,8 @@ public C createListenerContainer(JmsListenerEndpoint endpoint) {
200200 instance .setAutoStartup (this .autoStartup );
201201 }
202202
203- endpoint .setupListenerContainer (instance );
204203 initializeContainer (instance );
204+ endpoint .setupListenerContainer (instance );
205205
206206 return instance ;
207207 }
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2015 the original author or authors.
2+ * Copyright 2002-2018 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -149,6 +149,21 @@ public void backOffOverridesRecoveryInterval() {
149149 assertSame (backOff , new DirectFieldAccessor (container ).getPropertyValue ("backOff" ));
150150 }
151151
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+
152167
153168 private void setDefaultJmsConfig (AbstractJmsListenerContainerFactory <?> factory ) {
154169 factory .setConnectionFactory (connectionFactory );
You can’t perform that action at this time.
0 commit comments