Claus Ibsen created CAMEL-27897:
-----------------------------------

             Summary: camel-activemq6: an endpoint connectionFactory gets the 
broker URL of the component connectionFactory
                 Key: CAMEL-27897
                 URL: https://issues.apache.org/jira/browse/CAMEL-27897
             Project: Camel
          Issue Type: Bug
          Components: camel-activemq
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-activemq6 for 
CAMEL-23832 (pull request https://github.com/apache/camel/pull/31159).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. An endpoint connectionFactory gets the broker URL of the component one
In camel-activemq6 {{ActiveMQConfiguration.setConnectionFactory}}, when no 
brokerURL is configured, the URL of a set ActiveMQConnectionFactory is copied 
back with setBrokerURL(), which also sets customBrokerURL=true. A configuration 
copied from it (an endpoint) then overwrites the brokerURL of its own factory 
with that first URL: with component connectionFactory=ACF(A) and an endpoint 
connectionFactory=ACF(B) (as the doc page recommends for a clientId endpoint), 
ACF(B).setBrokerURL(A) is called, so the endpoint connects to broker A and the 
shared bean is changed.
Proposed change: assign the field directly in that branch without setting 
customBrokerURL. camel-activemq (5.x) has a related order dependency: 
setConnectionFactory only copies brokerURL when it was set before.

h4. 2. usePooledConnection fails by default without pooled-jms
usePooledConnection defaults to true, but pooled-jms is only a test dependency 
of camel-activemq6 (and camel-activemq), so without it on the classpath 
creating the connection factory fails with "Failed to instantiate 
PooledConnectionFactory".
Proposed change: make it a dependency, or default to false.

h4. 3. Smaller issues
usePooledConnection and useSingleConnection work as endpoint parameters 
(ActiveMQComponent.setProperties) but are not declared as endpoint options; 
ActiveMQConfiguration.loadClass ignores its name argument when a CamelContext 
is given. In camel-activemq, embedded=true needs activemq-broker 5.x, which 
depends on the javax client and may conflict with activemq-client-jakarta (not 
tested).


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to