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

   ## Summary
   
   `resolveEndpointDslUris()` in all four model dumpers (`LwModelToXMLDumper`, 
`JaxbModelToXMLDumper` via `JaxbHelper`, `LwModelToYAMLDumper`, 
`LwModelToJavaDumper`) called `setUri()` on live `FromDefinition` and 
`SendDefinition` objects before serialization. `setUri()` internally calls 
`clear()`, which permanently nulls 
`endpointConsumerBuilder`/`endpointProducerBuilder`. For endpoints with 
non-primitive builder properties (e.g. a custom `S3Client`), this causes Camel 
to lose the pre-configured bean reference and fall back to a default 
unconfigured client, resulting in route startup failures.
   
   The most common trigger is `AdviceWith.adviceWith()` with the default 
`logXml=true`, but any JMX `dumpRoutesAsXml()` call or startup dump on a 
context using Endpoint DSL hits the same bug.
   
   ## Changes
   
   - `resolveEndpointDslUris()` now saves builder references before calling 
`setUri()` and returns a `Runnable` that restores them
   - All four dumpers call the restorer in a `finally` block after 
serialization completes
   - Added `AdviceWithEndpointDslMutationTest` in `camel-endpointdsl` covering 
the XML dumper directly and through `adviceWith()` for both `FromDefinition` 
and `SendDefinition` builders
   
   ## Related
   
   - https://issues.apache.org/jira/browse/CAMEL-24052
   - Reproducer: https://github.com/bridgerdier/camel-advicewith-endpointdsl/
   
   _Claude Code on behalf of Croway_


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