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

   Aligns the dynamic-uri EIPs (`toD`, `recipientList`, `routingSlip`, 
`dynamicRouter`, `enrich`, `pollEnrich`) so that Camel property placeholders 
(`{{...}}`) are resolved once, at build time, on the endpoint URI written in 
the route — and not again per message on the evaluated recipient.
   
   ### What
   
   The dynamic-uri EIPs re-resolved property placeholders on the per-message 
evaluated recipient via:
   
   - `SendDynamicProcessor.resolveUri()` / `prepareRecipient()` (`toD`, 
`enrich`)
   - `ProcessorHelper.prepareRecipient()` (`recipientList`, `routingSlip`, 
`dynamicRouter`, `pollEnrich`)
   - `PollEnricher.resolveUri()` (`pollEnrich`)
   
   Placeholders in a dynamic-uri template are fixed at design time and are 
already resolved at build time (`ToDynamicReifier#createExpression` and the 
sibling reifiers, plus the `doInit` scheme detection). Re-resolving them for 
every exchange is redundant, and it meant a `{{...}}` token that only appeared 
in the evaluated result (for example produced from a message header or body) 
was unexpectedly re-interpreted as a property placeholder.
   
   The per-message paths now normalize the recipient via 
`NormalizedUri.newNormalizedUri(...)` without re-running placeholder 
resolution. The build-time (`doInit`) resolution on the static `uri` field is 
unchanged, so `{{...}}` written in the route template keeps working — the 
behaviour added in CAMEL-15087 is preserved. 
`getEndpoint(NormalizedEndpointUri)` already calls `doGetEndpoint(..., 
normalized=true, ...)` which skips resolution, so nothing re-resolves 
downstream either.
   
   ### Tests
   
   - New `DynamicEndpointMessagePlaceholderTest` — for each EIP (`toD`, 
`recipientList`, `routingSlip`, `enrich`, `pollEnrich`) a `{{...}}` arriving 
via a message header is treated as a literal endpoint uri; plus a control 
asserting a `{{...}}` written in the static route template is still resolved.
   - Existing placeholder / EIP suites remain green 
(`ToDynamicPropertyPlaceholderTest`, `PropertiesComponentEIPRoutingSlipTest`, 
and the recipientList / routingSlip / enricher / pollEnricher tests).
   - Full reactor build (`mvn clean install -DskipTests`) succeeds with no 
generated-file drift.
   
   ### Docs
   
   Migration note added to the 4.22 upgrade guide (behavioural change for 
routes that produced a `{{...}}` token from message content and relied on it 
being expanded).
   
   ---
   _Claude Code on behalf of Andrea Cosentino (@oscerd)_
   


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