Spring boot autoconfiguration AutoConfigureAfter
<p>I'm trying to create a fallback ConnectionFactory in case the JndiConnectionFactoryAutoConfiguration did not create one for me.</p>

<p>Here's what the class looks like</p>

<pre><code>@Configuration
@AutoConfigureAfter(JndiConnectionFactoryAutoConfiguration.class)
@ConditionalOnMissingBean(ConnectionFactory.class)
@ConditionalOnClass(ConnectionFactory.class)
public class JmsFallbackAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    ConnectionFactory fallbackConfiguration() {
        ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");
        System.out.println("Created: " + activeMQConnectionFactory);
        return activeMQConnectionFactory;
    }

}
</code></pre>

<p>What I'm expecting is spring boot starts, some auto configuration is going on, we get to JndiConnectionFactoryAutoConfiguration which notices that I have spring.jms.jndi-name set and creates the ConnectionFactory bean.</p>

<p>Then, at some point, I'm expecting it to get to JmsFallbackAutoConfiguration when it should notice that we already have a ConnectionFactory (which was configured by JndiConnectionFactoryAutoConfiguration) and move on.</p>

<p>But that's not what happens, JmsFallbackAutoConfiguration always executes and I don't know what I'm missing.</p>

<p>Sample project here <a href="https://github.com/apixandru/case-study/tree/master/spring-boot-weblogic-jms/spring-boot-weblogic-jms-war" rel="nofollow">https://github.com/apixandru/case-study/tree/master/spring-boot-weblogic-jms/spring-boot-weblogic-jms-war</a></p>