CAMEL-24282: Resolve dynamic-URI property placeholders at build time instead of per message - #25198
CAMEL-24282: Resolve dynamic-URI property placeholders at build time instead of per message#25198oscerd wants to merge 1 commit into
Conversation
…instead of per message Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
|
@davsclaus this has been converted to draft because it requires some attention. |
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 548 tested, 28 compile-only — current: 547 all testedMaveniverse Scalpel detected 576 affected modules (current approach: 547).
|
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#createExpressionand the sibling reifiers, plus thedoInitscheme 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 staticurifield is unchanged, so{{...}}written in the route template keeps working — the behaviour added in CAMEL-15087 is preserved.getEndpoint(NormalizedEndpointUri)already callsdoGetEndpoint(..., normalized=true, ...)which skips resolution, so nothing re-resolves downstream either.Tests
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.ToDynamicPropertyPlaceholderTest,PropertiesComponentEIPRoutingSlipTest, and the recipientList / routingSlip / enricher / pollEnricher tests).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)