Croway commented on code in PR #27667:
URL: https://github.com/apache/camel/pull/27667#discussion_r4240763987
##########
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 });
+ for (String key : propJVM.stringPropertyNames()) {
+ prop.put("SYS", MainHelper.optionKey(key),
propJVM.getProperty(key));
+ }
+
+ OrderedLocationProperties options = new OrderedLocationProperties();
+ for (Object k : prop.keySet()) {
+ String key = k.toString();
+ if (startsWithIgnoreCase(key, PREFIX_SERVER)) {
Review Comment:
Removed in e19f3dbd1653: every source is already filtered on
`camel.server.`, so the loop now only skips `enabled`.
_Claude Code on behalf of Croway_
##########
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:
Added in e19f3dbd1653: `CAMEL_SERVER_*` environment variables are loaded
with `MainHelper.loadEnvironmentVariablesAsProperties` and override the
properties files, and JVM system properties override both, as in camel-main.
The module has no way to set an environment variable in a test, so I checked it
by running `MainHttpServerFactoryTest` with `CAMEL_SERVER_PATH=/env` (the
default-path test then fails with `/env`). A new test covers a JVM system
property overriding `application.properties`. Same commit on #27668.
_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]