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

   A point of item 7 of 
[CAMEL-26930](https://issues.apache.org/jira/browse/CAMEL-26930) that was found 
by reading the code; it extends item 1 of CAMEL-26912.
   
   ## Problem
   
   When a route uses platform-http, the run starts an HTTP server for it 
(`MainHttpServerFactory.setupHttpServer` in camel-kamelet-main). It applied the 
`camel.server.*` configuration, and then took the port from 
`.camel-jbang/camel-jbang-run.properties` of the current directory. That file 
is written by every `camel run` in that folder, for `camel export`. So a second 
run in the same folder (another integration, or the same one with `--port`), or 
a run whose server starts later (such as a route with platform-http added in 
dev mode), could get the port of another run: the port the configuration gave 
was overridden.
   
   ## Change
   
   The port is the one of the configuration of the run: `camel run --port` is 
in its initial properties already (`RunSettings.write` sets the initial 
property and writes the setting), as are `application.properties`, environment 
variables and system properties. The run settings file is no longer read for 
it. The port is still written to the file when the run did not write it, for 
`camel export`.
   
   ## Tests
   
   - `MainHttpServerFactoryTest.theRunSettingsOfAnotherRunDoNotChangeThePort` 
(new): with `camel.server.port=7777` in the run settings file and 9090 in the 
configuration, the server gets 9090; without the fix it got 7777. The test 
restores the file of the module folder.
   - camel-kamelet-main: 85 pass. camel-jbang-run: 323 pass. camel-jbang-core: 
3087 + 266 pass (`DependencyUpdateTest` flaked once and passed on the rerun).
   
   _Claude Code on behalf of davsclaus_
   
   🤖 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