[
https://issues.apache.org/jira/browse/CAMEL-25828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-25828.
---------------------------------
Resolution: Not A Problem
Not a problem, my mistake: camel-jms has its own autowiring of the connection
factory, the option {{allowAutoWiredConnectionFactory}} (on by default, since
CAMEL-14213 in 2019). In {{JmsComponent.doInit()}}, when no connection factory
and no transaction manager are set, and the registry has exactly one
{{ConnectionFactory}}, the component uses it. The {{"autowired": false}} in the
metadata is about the general autowiring of Camel, which this option does not
use.
What the benchmark hit was something else: the jms page had no example
(CAMEL-25783), and a reload in dev mode does not create a bean that is added to
application.properties (CAMEL-25767). The component also autowires only when it
starts, so a bean that a reload adds later would not be picked up either.
CAMEL-25783 now says that a single connection factory is used without the
option.
_Claude Code on behalf of davsclaus_
> 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
> Priority: Major
> 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)