Commit c6c2959a authored by Phillip Webb's avatar Phillip Webb

Merge remote-tracking branch '1.3.x'

parents 5ed4ef12 a9afe0a9
...@@ -42,8 +42,8 @@ public final class RabbitListenerContainerFactoryConfigurer { ...@@ -42,8 +42,8 @@ public final class RabbitListenerContainerFactoryConfigurer {
} }
/** /**
* Create a new and pre-configured {@link SimpleRabbitListenerContainerFactory} instance * Create a new and pre-configured {@link SimpleRabbitListenerContainerFactory}
* for the specified {@link ConnectionFactory}. * instance for the specified {@link ConnectionFactory}.
* @param connectionFactory the {@link ConnectionFactory} to use. * @param connectionFactory the {@link ConnectionFactory} to use.
* @return a pre-configured {@link SimpleRabbitListenerContainerFactory} * @return a pre-configured {@link SimpleRabbitListenerContainerFactory}
*/ */
...@@ -57,7 +57,8 @@ public final class RabbitListenerContainerFactoryConfigurer { ...@@ -57,7 +57,8 @@ public final class RabbitListenerContainerFactoryConfigurer {
/** /**
* Apply the default settings for the specified jms listener container factory. The * Apply the default settings for the specified jms listener container factory. The
* factory can be further tuned and default settings can be overridden. * factory can be further tuned and default settings can be overridden.
* @param factory the {@link SimpleRabbitListenerContainerFactory} instance to configure * @param factory the {@link SimpleRabbitListenerContainerFactory} instance to
* configure
* @param connectionFactory the {@link ConnectionFactory} to use * @param connectionFactory the {@link ConnectionFactory} to use
*/ */
public void configure(SimpleRabbitListenerContainerFactory factory, public void configure(SimpleRabbitListenerContainerFactory factory,
......
...@@ -49,7 +49,8 @@ class JmsAnnotationDrivenConfiguration { ...@@ -49,7 +49,8 @@ class JmsAnnotationDrivenConfiguration {
@Bean @Bean
@ConditionalOnMissingBean(name = "jmsListenerContainerFactory") @ConditionalOnMissingBean(name = "jmsListenerContainerFactory")
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory( public DefaultJmsListenerContainerFactory jmsListenerContainerFactory(
JmsListenerContainerFactoryConfigurer configurer, ConnectionFactory connectionFactory) { JmsListenerContainerFactoryConfigurer configurer,
ConnectionFactory connectionFactory) {
return configurer.createJmsListenerContainerFactory(connectionFactory); return configurer.createJmsListenerContainerFactory(connectionFactory);
} }
......
...@@ -50,8 +50,8 @@ public final class JmsListenerContainerFactoryConfigurer { ...@@ -50,8 +50,8 @@ public final class JmsListenerContainerFactoryConfigurer {
} }
/** /**
* Set the {@link JtaTransactionManager} to use or {@code null} if the JTA * Set the {@link JtaTransactionManager} to use or {@code null} if the JTA support
* support should not be used. * should not be used.
* @param transactionManager the {@link JtaTransactionManager} * @param transactionManager the {@link JtaTransactionManager}
*/ */
@Autowired(required = false) @Autowired(required = false)
......
...@@ -204,15 +204,18 @@ public class JmsAutoConfigurationTests { ...@@ -204,15 +204,18 @@ public class JmsAutoConfigurationTests {
@Test @Test
public void testCustomContainerFactoryWithConfigurer() { public void testCustomContainerFactoryWithConfigurer() {
this.context = doLoad(new Class<?>[]{TestConfiguration9.class, this.context = doLoad(
EnableJmsConfiguration.class}, "spring.jms.listener.autoStartup=false"); new Class<?>[] { TestConfiguration9.class, EnableJmsConfiguration.class },
"spring.jms.listener.autoStartup=false");
assertThat(this.context.containsBean("jmsListenerContainerFactory")).isTrue(); assertThat(this.context.containsBean("jmsListenerContainerFactory")).isTrue();
JmsListenerContainerFactory<?> jmsListenerContainerFactory = this.context.getBean( JmsListenerContainerFactory<?> jmsListenerContainerFactory = this.context.getBean(
"customListenerContainerFactory", JmsListenerContainerFactory.class); "customListenerContainerFactory", JmsListenerContainerFactory.class);
assertThat(jmsListenerContainerFactory).isInstanceOf(DefaultJmsListenerContainerFactory.class); assertThat(jmsListenerContainerFactory)
.isInstanceOf(DefaultJmsListenerContainerFactory.class);
DefaultMessageListenerContainer listenerContainer = ((DefaultJmsListenerContainerFactory) jmsListenerContainerFactory) DefaultMessageListenerContainer listenerContainer = ((DefaultJmsListenerContainerFactory) jmsListenerContainerFactory)
.createListenerContainer(mock(JmsListenerEndpoint.class)); .createListenerContainer(mock(JmsListenerEndpoint.class));
assertThat(listenerContainer.getCacheLevel()).isEqualTo(DefaultMessageListenerContainer.CACHE_CONSUMER); assertThat(listenerContainer.getCacheLevel())
.isEqualTo(DefaultMessageListenerContainer.CACHE_CONSUMER);
assertThat(listenerContainer.isAutoStartup()).isFalse(); assertThat(listenerContainer.isAutoStartup()).isFalse();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment