davsclaus opened a new pull request, #27076: URL: https://github.com/apache/camel/pull/27076
Fixes items 1 and 2 of CAMEL-25067 (item 4 is in #27071, item 3 was already fixed by CAMEL-25114). 1. **interceptSendToEndpoint: intercepted route**: a `RouteBuilder`-level `interceptSendToEndpoint` is reified once per route, but the endpoint is only decorated by the first route's callback (the others see an already decorated endpoint). The `INTERCEPTED_ROUTE_ID` / `INTERCEPTED_ROUTE_ENDPOINT_URI` properties were therefore always those of the first route. They're now taken from the route that is sending (the exchange's current route), falling back to the registering route when there is none (such as a `ProducerTemplate` sending directly to the endpoint). Documented in the 4.23 upgrade guide. 2. **Load balancer ids**: `LoadBalanceReifier` creates its children with `createProcessor` (not `createOutputsProcessor`) and returns the balancer wrapped in a channel, so neither the balancer nor its outputs got their id, route id or step id, and `context.getProcessor(id)` didn't find them. The id injection is now a `ProcessorReifier.injectIds` helper (the two existing copies use it too) that the load balance reifier calls for the balancer and each output. Tests that fail without the fixes: `LoadBalanceIdTest`, `InterceptPropertiesTest#testInterceptSendToEndpointPropertiesTwoRoutes`. The full camel-core test suite passes (7968 tests). **Not changed, needs a design decision (found while fixing item 1):** the decorated endpoint's before-processors belong to the first route (wrapped in its error handler). When that route is removed, every other route that sends to the intercepted endpoint fails with `RejectedExecutionException`. Replacing the registry entry isn't enough, because the other routes' producers were already created from the decorated endpoint. Route reload (removing and re-adding routes) is likely affected the same way. Fixing this properly needs a per-route dispatch behind the decorated endpoint, so it's left out of this PR. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
