Claus Ibsen created CAMEL-25828:
-----------------------------------

             Summary: camel-jms - autowire the connection factory when the 
registry has exactly one
                 Key: CAMEL-25828
                 URL: https://issues.apache.org/jira/browse/CAMEL-25828
             Project: Camel
          Issue Type: Improvement
          Components: camel-jms
            Reporter: Claus Ibsen
             Fix For: 4.24.0


The {{connectionFactory}} option of the jms component is not autowired 
({{"autowired": false}} in its metadata, also in camel-activemq and 
camel-amqp). So a connection factory bean alone does nothing. An app also needs 
{{camel.component.jms.connection-factory = #bean:myCF}}, or 
{{connectionFactory=#myCF}} on each endpoint. Options of the same kind in other 
components are autowired, such as the {{dataSource}} of camel-sql: when the 
registry has exactly one bean of the type, the component uses it.

In a benchmark of Oct 18-19 2026, a local model had to find both lines to 
connect jms to ActiveMQ Artemis (JMS step 1: 0 of 6 runs). CAMEL-25783 adds the 
docs.

The option is older than autowiring, so changing its default needs care:
* camel-jms, camel-activemq and camel-amqp share {{JmsConfiguration}}.
* An app with several connection factories is not affected, as autowiring needs 
exactly one bean of the type. But an app with one connection factory that it 
gives to one endpoint only would see the component use it for every endpoint.
* A Spring Boot app may have a connection factory bean already, such as one 
from spring-boot-starter-artemis, which the component would then use.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to