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

   Under `camel run`, a route that uses `transacted` started, but processed 
nothing: no step ran, nothing was logged, and every message was gone without an 
error. This has been the case since 4.10.
   
   Reproduction: a timer route with a log, then `transacted`, then a log. With 
`transacted` there is no log line; without it, both lines are logged. The debug 
log shows the route as `Route[timer://tx?... -> null]`.
   
   **Why**
   
   camel run binds a placeholder `TransactedPolicy` under the `PROPAGATION_*` 
names, so that a route with `transacted` can start without a transaction 
manager (`camel export` needs this to find the dependencies). Its `wrap()` 
returned null. The route then had no processor, and `CamelInternalProcessor` 
treats a null processor as done. The placeholder also replaced a policy of the 
user's own with the same name.
   
   **What changes**
   
   - The placeholder runs the steps without a transaction, and camel run logs a 
WARN for the route: it runs without a transaction; declare a transaction 
manager bean, or export to Spring Boot or Quarkus, for transactions.
   - It is bound only when the `transacted` has no policy or `ref` of its own, 
and the registry has no transaction policy and no Spring 
`PlatformTransactionManager` (of which Camel makes the policy). A policy of the 
user's own is used as it is.
   - The check loads the Spring class with the application class loader, not 
with camel run's class resolver. That one downloads camel-spring to load the 
class, and `camel export` would then add it to the project.
   
   Real local transactions with a datasource follow in CAMEL-26851.
   
   **Tests**
   
   - New `TransactedDownloaderTest`: a transacted route without a transaction 
manager runs its steps; a policy of the user's own is kept and used; a 
`transacted` with a `ref` is left as it is. The first test fails with the old 
placeholder ("Received message count. Expected: <1> but was: <0>").
   - Checked through `KameletMain` with downloads off: the message reaches the 
end of the route, the WARN is logged, and the route asks for camel-jta, not 
camel-spring.
   - camel-kamelet-main: 69 tests, 0 failures, 8 skipped (manual tests).
   
   No backport.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_016Y4dDi5iQNgtHrDdz2NpwF
   


-- 
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