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

   https://issues.apache.org/jira/browse/CAMEL-26848
   
   The chaos example fails to start when it is run from the TUI:
   
   ```
   Failed to resolve endpoint: http://localhost:{{camel.server.port}}/payment 
due to: Property with key [camel.server.port] not found
   ```
   
   The TUI runs an example on the Camel Main runtime by default, which exports 
the example to a Maven project first. The export removes from 
`application.properties` every key of the run settings that is not 
`camel.main.*`. The run settings repeat some keys of the user's 
`application.properties`, such as `camel.server.port`, so those keys were lost 
too. Plain `camel run` (the jbang runtime) was not affected.
   
   A port other than 8080 happened to work, because the Camel Main exporter 
adds `camel.server.port` back when it is not the default. The example uses 8080.
   
   The fix: a key that `application.properties` sets is kept, with its own 
value. A key that only the run settings have, such as 
`camel.component.properties.location`, is still removed. For Spring Boot and 
Quarkus, the user's `camel.server.port` now stays in the export too, so a 
`{{camel.server.port}}` placeholder resolves there as well.
   
   Test: 
`ProjectExporterTest#keepsTheKeysOfTheApplicationPropertiesThatTheRunSettingsRepeat`
 fails without the fix and passes with it. All export tests pass. I also 
reproduced the bug with `camel export --runtime=camel-main` of the chaos 
example: before the fix, `camel.server.port` is missing from the exported 
`application.properties`.
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS
   


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