smongiar commented on PR #2078:
URL: 
https://github.com/apache/camel-spring-boot/pull/2078#issuecomment-6737296243

   @Croway thanks for the detailed review and the reproduction, I agree with 
the analysis: `isConfigured()` only knows what Spring Boot bound, so a value 
set in Java on the starter configuration bean before the customizer runs is 
dropped. The same code is on `main` (#1951), so backporting it would spread the 
regression to 4.22.x.
   
   I am converting this PR to draft and will not ask for a merge until the 
regression is solved on `main` first. Before I open a CAMEL ticket, which 
direction do you prefer?
   
   **A. Fix the helper (my proposal, for `main` and then 4.22.x).** In 
`copyConfigurationProperties`, copy an option if it was bound **or** if its 
value differs from the value of a freshly constructed instance of the same 
configuration class. A catalog default equals the fresh instance's value, so it 
is still not copied; a Java assignment like `setSkipRequestHeaders(true)` 
differs, so it is copied again. No generator change and no regeneration of the 
~425 starters. Open points: Map/List options, and a safe fallback (current 
bound-only behaviour) when the class cannot be instantiated.
   
   **B. Stop emitting the literal initializers** (item 2 of CAMEL-24501). 
Cleanest model, but it regenerates all starters and changes the getter defaults 
on the configuration beans, so I would not do it on 4.22.x.
   
   **C. Narrow `ai-tool` generator change.** Do not initialize the four 
nullable MCP hint fields (`readOnlyHint`, `destructiveHint`, `idempotentHint`, 
`openWorldHint`) in `SpringBootAutoConfigurationMojo`. It fixes the unset-hints 
symptom (CSB-13052) with no behaviour change for other starters, but leaves the 
general problem in place. It would be a stopgap for 4.22.x only.
   
   My plan, if you agree: keep this backport as a draft, create a CAMEL ticket 
for the regression and fix it with A on `main` (using your 
`HttpComponentConfiguration` scenario as a test), then backport both commits to 
4.22.x. If you would rather not risk the helper on 4.22.x, I would go with C 
there.
   
   Do you also want to take the CAMEL ticket yourself, since you found the 
regression?
   


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