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

   The dynamic-endpoint EIPs -- `toD`, `enrich`, `wireTap`, `pollEnrich`, 
`recipientList`, `routingSlip` and
   `dynamicRouter` -- compute their target endpoint from the current message at 
runtime.
   
   CAMEL-24282 and CAMEL-24414 already made the per-message *uri path* literal 
for `toD`, `enrich`, `wireTap` and
   `pollEnrich` (a `{{...}}` token coming from the message is not re-resolved). 
That treatment never reached the endpoint
   *option binding*: the query option values of a per-message endpoint were 
still bound through `PropertyBindingSupport`
   with reference and placeholder resolution enabled, so an option value that 
contained a `{{...}}` token, or a
   `#class:` / `#bean:` / `#type:` reference, was resolved (and `#class:` even 
instantiated a class) although it came from
   the message and not from the route.
   
   ## Change
   
   Extend the existing per-message "bind literally" contract from the uri path 
to the option binding:
   
   - `PropertyBindingSupport` gains a literal binding mode 
(`Builder.withLiteral(true)`) that binds a value as plain text:
     it skips property-placeholder resolution and the `resolveValue` / 
`resolveBean` reference pass, and disables
     reference resolution on the reflection and configurer paths. A plain 
`withReference(false)` / `withPlaceholder(false)`
     is not enough, because `resolveValue` runs independently of those flags.
   - The dynamic EIPs mark the per-message recipient `NormalizedUri` as 
literal-option-binding. The flag is carried
     through endpoint lookup and creation (`AbstractCamelContext.doGetEndpoint` 
-> `DefaultComponent.createEndpoint` ->
     `DefaultEndpoint`), so that only a per-message endpoint selects the 
literal mode; endpoints created from the static
     route template are bound exactly as before.
   - For `recipientList`, `routingSlip` and `dynamicRouter` the documented 
resolution of property placeholders in the
     computed uri string is preserved; only the bean/class reference resolution 
of their runtime option values is brought
     in line.
   
   Property placeholders written in the static route template are unaffected: 
they are still resolved once, at build time,
   by the reifier.
   
   ## Tests
   
   `DynamicEndpointMessageOptionLiteralTest` (camel-core) asserts, for `toD`, 
`enrich`, `pollEnrich`, `recipientList`,
   `routingSlip` and `dynamicRouter`, that a `{{...}}` token and a `#class:` / 
`#bean:` reference in a runtime-computed
   option value are kept literal: the token is not resolved, no class is 
instantiated and no bean is looked up. It is the
   option-binding companion to the existing 
`DynamicEndpointMessagePlaceholderTest`.
   
   An upgrade-guide note is added for 4.24.
   
   _Claude Code on behalf of oscerd_
   
   🤖 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]

Reply via email to