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

   [CAMEL-27237](https://issues.apache.org/jira/browse/CAMEL-27237)
   
   `camel export --runtime=camel-main` of a route that uses platform-http (or 
rest) turns on the embedded HTTP server and its health check in the exported 
`application.properties` (`camel.management.health-check-enabled=true`). The 
dependencies were resolved before that, from the `application.properties` given 
to the export, so the exported `pom.xml` had no `camel-health` and the 
application failed at startup:
   
   ```
   java.lang.IllegalArgumentException: Camel health-check is not available. Add 
camel-health or camel-observability-services JAR
   ```
   
   `camel run` does not show it, as the Camel CLI has `camel-health` on its 
classpath.
   
   The exporter now adds `camel:health` where it turns the health check on, 
unless the dependencies already have it (from `--console`, or from an 
`application.properties` that turns the health check on itself).
   
   ### Tests
   
   - `ExportDependencyTest#shouldAddCamelHealthWhenTheHealthCheckIsOn`: the 
case without a health key in the `application.properties` fails on main and 
passes with the fix; the case with the key checks that `camel-health` is there 
once.
   - `golden/expected/openapi.export.txt`: the openapi export 
(platform-http-main, health check on) now has `camel-health`, the only change 
after `-Dcamel.golden.update=true`.
   - `ExportDependencyTest`, `ExportConsoleTest`, 
`ExportMainApplicationPropertiesTest`, `RunExportGoldenTest` (camel-jbang-core) 
and `KubernetesExportTest` (camel-jbang-plugin-kubernetes) pass.
   - By hand: a platform-http route exported with the Camel CLI 4.23.0 starts 
once `camel-health` is in its `pom.xml`, and `/observe/health` answers 
`{"status":"UP"}`.
   
   No upgrade guide entry: an exported project gets the dependency its 
configuration already needed.
   
   _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