davsclaus commented on code in PR #27667:
URL: https://github.com/apache/camel/pull/27667#discussion_r4240437191
##########
dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/download/MainHttpServerFactory.java:
##########
@@ -56,6 +70,37 @@ public static MainHttpServer setupHttpServer(CamelContext
camelContext, boolean
return server;
}
+ /**
+ * Binds the camel.server.* properties (application.properties,
--properties, initial and override properties and
+ * JVM system properties) on the configuration of the HTTP server that is
started implicitly for platform-http, as
+ * camel-main only applies them to the server it starts itself when
camel.server.enabled=true.
+ */
+ static void configureHttpServer(CamelContext camelContext,
HttpServerConfigurationProperties config) {
+ OrderedLocationProperties prop = (OrderedLocationProperties)
camelContext.getPropertiesComponent()
+ .loadProperties(name -> startsWithIgnoreCase(name,
PREFIX_SERVER), MainHelper::optionKey);
+ Properties propJVM =
MainHelper.loadJvmSystemPropertiesAsProperties(new String[] { PREFIX_SERVER });
Review Comment:
Unlike camel-main, this doesn't pick up `CAMEL_SERVER_*` environment
variables (camel-main reads ENV first, then JVM system properties override).
Port is not affected (`_PORT` keys are skipped), but e.g. `CAMEL_SERVER_HOST` /
`CAMEL_SERVER_PATH` would still be ignored by this server. Something like:
```java
Properties propENV = MainHelper.loadEnvironmentVariablesAsProperties(new
String[] { PREFIX_SERVER });
for (String key : propENV.stringPropertyNames()) {
prop.put("ENV", MainHelper.optionKey(key), propENV.getProperty(key));
}
```
--
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]