[ 
https://issues.apache.org/jira/browse/CAMEL-26693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18139783#comment-18139783
 ] 

Federico Mariani commented on CAMEL-26693:
------------------------------------------

[PR #29344|https://github.com/apache/camel/pull/29344] keeps the default: with 
only {{brokerURL}}, each endpoint still creates its own connection factory. The 
proposed change above (one factory for the component by default, with an 
upgrade-guide entry) is not done, because the measurements showed that it 
breaks working setups (embedded ActiveMQ Classic 6.3.2 broker, pooled-jms 
3.2.5):
* Endpoints with different {{clientId}} values cannot share one pool: the 
second one never subscribes, and retries forever with "Setting clientID on a 
used Connection is not allowed".
* One pool for all endpoints puts a component-wide limit of 500 sessions on it, 
and {{blockIfSessionPoolIsFull}} waits forever: with 4 endpoints and 130 
consumers each, a send was still blocked after 10 seconds. With a pool per 
endpoint it went through.
* A {{transactionManager}} on a factory of its own does not help: the sent 
message was still not rolled back.

Instead, the docs of camel-activemq and camel-activemq6 have a new section 
"Connection factory and transactions": to make a send from a transacted route 
part of the transaction of the consumer, set one {{connectionFactory}} on the 
component, and any {{transactionManager}} on that same factory. No 
upgrade-guide entry, as the default is unchanged.

The PR also fixes a bug found while measuring: after a component stop and 
start, the endpoints kept pools that the stop had stopped, so every send failed 
with {{ConnectionFactory returned null from createConnection()}}. {{doStop}} 
now closes the connections and keeps the factories usable; {{doShutdown}} stops 
them.

_Claude Code on behalf of Federico Mariani_

> camel-activemq, camel-activemq6 - with only brokerURL set, a send from a 
> transacted route is not rolled back
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-26693
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26693
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-activemq
>    Affects Versions: 4.18.5, 4.22.2, 4.23.0
>            Reporter: Federico Mariani
>            Assignee: Federico Mariani
>            Priority: Major
>




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

Reply via email to