davsclaus opened a new pull request, #24729:
URL: https://github.com/apache/camel/pull/24729

   ## Summary
   
   Fixes component-level `transacted=true` breaking `ConnectionFactory` 
autowiring during startup with `IllegalArgumentException: connectionFactory 
must be specified`.
   
   The guard condition in `JmsComponent.doInit()` used 
`getOrCreateTransactionManager()` which eagerly creates a 
`JmsTransactionManager` — and that requires a `ConnectionFactory` that hasn't 
been autowired yet (since the autowiring is the body of the very if-statement 
being evaluated). Changed to `getTransactionManager()` (plain getter, no side 
effects) so the guard only checks whether a TM was explicitly configured, 
without triggering lazy creation.
   
   - **Root cause**: CAMEL-14220 changed `getTransactionManager()` → 
`getOrCreateTransactionManager()` to fix camel-activemq (which overrides 
`createConnectionFactory()` and is unaffected). Plain camel-jms has no such 
override and throws.
   - **Fix**: Revert the guard to `getTransactionManager()`. The lazy TM 
creation still happens later when the endpoint/consumer is actually created.
   - **Tests**: Added `JmsTransactedAutowiredConnectionFactoryTest` — 
reproducer that fails without the fix. All camel-jms (437 tests), 
camel-activemq, and camel-activemq6 tests pass.
   
   _Claude Code on behalf of davsclaus_
   
   Co-Authored-By: Claude Opus 4.6 <[email protected]>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to