amqphub / amqp-10-jms-spring-boot

AMQP 1.0 JMS Binding for Spring Boot
Apache License 2.0
35 stars 25 forks source link

Autoconfiguration creates JMS connection factory even if another one is already created #8

Closed jammann closed 5 years ago

jammann commented 5 years ago

We wanted to have both ActiveMQ and this Spring boot starter in our project. Default should be QPid, but if we activate a Spring profile "activemq", we explicitly create an ActiveMQ connection factory to use that. We would have expected that then this Autoconfigure does not create a second connectionFactory.

But this does not work, because the Autoconfigure misses something like the annotation

@ConditionalOnMissingBean(ConnectionFactory.class)

The ActiveMQ autoconfiguration has something like that, and hence is not creating a second connectionFactory if one already exists.

I think it would make sense to add such an annotation also for QPid

roro0290 commented 1 year ago

Hi, in my case, the project is not using this auto configuration to create the connection factory as there might be another connection factory present (e.g. ConditionalOnMissingBean(ConnectionFactory.class) = false) What would be a workaround for this?