Commit d2198c41 authored by Stephane Nicoll's avatar Stephane Nicoll

Fix ConnectionFactory auto-configuration with XA

Previously, the regular jms connection factory was always overriding
the xaConnectionFactory when using ActiveMQ. While
ActiveMQAutoConfiguration is namely shielded with a condition on a
missing ConnectionFactory bean, said configuration class also imports the
XA and regular configuration classes that both can create the connection
factory.

This commit adds a ConditionalOnMissingBean in the second class that is
imported in case the XA configuration has already defined what it needs.

Fixes gh-1727
parent 47285f9f
......@@ -20,6 +20,8 @@ import javax.jms.ConnectionFactory;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.pool.PooledConnectionFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......@@ -32,6 +34,7 @@ import org.springframework.context.annotation.Configuration;
* @since 1.1.0
*/
@Configuration
@ConditionalOnMissingBean(ConnectionFactory.class)
class ActiveMQConnectionFactoryConfiguration {
@Bean
......
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