This is an automated email from the ASF dual-hosted git repository. pcongiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 06ddc18877fde5b0b79c5086074b2277b0d67f31 Author: Pasquale Congiusti <pasquale.congiu...@gmail.com> AuthorDate: Tue Apr 22 16:00:57 2025 +0200 feat(main): introduce management settings --- .../main/camel-main-configuration-metadata.json | 35 ++- .../http/main/DefaultMainHttpServerFactory.java | 42 ++++ .../BasicAuthenticationConfigurer.java | 18 ++ .../JWTAuthenticationConfigurer.java | 30 +++ .../MainAuthenticationConfigurer.java | 5 + .../http/vertx/VertxPlatformHttpRouter.java | 12 + ...entServerConfigurationPropertiesConfigurer.java | 184 ++++++++++++++ .../camel-main-configuration-metadata.json | 35 ++- ...ain.HttpManagementServerConfigurationProperties | 2 + core/camel-main/src/main/docs/main.adoc | 43 +++- .../org/apache/camel/main/BaseMainSupport.java | 51 +++- ...tpManagementServerConfigurationProperties.java} | 268 ++++----------------- .../main/HttpServerConfigurationProperties.java | 43 +++- .../camel/main/MainConfigurationProperties.java | 22 ++ .../apache/camel/main/MainHttpServerFactory.java | 10 + .../maven/packaging/PrepareCamelMainMojo.java | 6 + 16 files changed, 538 insertions(+), 268 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json index 54457232325..760a8ac8c24 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/main/camel-main-configuration-metadata.json @@ -4,6 +4,7 @@ { "name": "camel.startupcondition", "description": "Camel Startup Condition configurations", "sourceType": "org.apache.camel.main.StartupConditionConfigurationProperties" }, { "name": "camel.routecontroller", "description": "Camel Route Controller configurations", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties" }, { "name": "camel.server", "description": "Camel Embedded HTTP Server (only for standalone; not Spring Boot or Quarkus) configurations", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties" }, + { "name": "camel.management.server", "description": "Camel Embedded HTTP management Server (only for standalone; not Spring Boot or Quarkus) configurations", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties" }, { "name": "camel.debug", "description": "Camel Debugger configurations", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties" }, { "name": "camel.trace", "description": "Camel Tracer configurations", "sourceType": "org.apache.camel.main.TracerConfigurationProperties" }, { "name": "camel.ssl", "description": "Camel SSL configurations", "sourceType": "org.apache.camel.main.SSLConfigurationProperties" }, @@ -189,6 +190,26 @@ { "name": "camel.lra.enabled", "description": "To enable Saga LRA", "sourceType": "org.apache.camel.main.LraConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": false }, { "name": "camel.lra.localParticipantContextPath", "description": "The context-path for the local participant. Is default \/lra-participant", "sourceType": "org.apache.camel.main.LraConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/lra-participant" }, { "name": "camel.lra.localParticipantUrl", "description": "The URL for the local participant", "sourceType": "org.apache.camel.main.LraConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, + { "name": "camel.management.server.authenticationEnabled", "description": "Whether to enable HTTP authentication for embedded server (for standalone applications; not Spring Boot or Quarkus).", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.management.server.authenticationPath", "description": "Set HTTP url path of embedded server that is protected by authentication configuration.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, + { "name": "camel.management.server.basicPropertiesFile", "description": "Name of the file that contains basic authentication info for Vert.x file auth provider.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, + { "name": "camel.management.server.devConsoleEnabled", "description": "Whether to enable developer console (not intended for production use). Dev console must also be enabled on CamelContext. For example by setting camel.context.dev-console=true in application.properties, or via code camelContext.setDevConsole(true); If enabled then you can access a basic developer console on context-path: \/q\/dev.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", [...] + { "name": "camel.management.server.enabled", "description": "Whether embedded HTTP server is enabled. By default, the server is not enabled.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.management.server.healthCheckEnabled", "description": "Whether to enable health-check console. If enabled then you can access health-check status on context-path: \/q\/health (default)", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.management.server.healthPath", "description": "The path endpoint used to expose the health status", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/observe\/health" }, + { "name": "camel.management.server.host", "description": "Hostname to use for binding embedded HTTP server", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "0.0.0.0" }, + { "name": "camel.management.server.infoEnabled", "description": "Whether to enable info console. If enabled then you can see some basic Camel information at \/q\/info", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.management.server.jolokiaEnabled", "description": "Whether to enable jolokia. If enabled then you can access jolokia api on context-path: \/q\/jolokia", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.management.server.jolokiaPath", "description": "The path endpoint used to expose the jolokia data.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/observe\/jolokia" }, + { "name": "camel.management.server.jwtKeystorePassword", "description": "Password from the keystore used for JWT tokens validation.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, + { "name": "camel.management.server.jwtKeystorePath", "description": "Path to the keystore file used for JWT tokens validation.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, + { "name": "camel.management.server.jwtKeystoreType", "description": "Type of the keystore used for JWT tokens validation (jks, pkcs12, etc.).", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, + { "name": "camel.management.server.maxBodySize", "description": "Maximum HTTP body size the embedded HTTP server can accept.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "integer", "javaType": "java.lang.Long" }, + { "name": "camel.management.server.metricsEnabled", "description": "Whether to enable metrics. If enabled then you can access metrics on context-path: \/q\/metrics (default)", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.management.server.path", "description": "Context-path to use for embedded HTTP server", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/" }, + { "name": "camel.management.server.port", "description": "Port to use for binding embedded HTTP server", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 9876 }, + { "name": "camel.management.server.sendEnabled", "description": "Whether to enable sending messages to Camel via HTTP. This makes it possible to use Camel to send messages to Camel endpoint URIs via HTTP.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.management.server.useGlobalSslContextParameters", "description": "Whether to use global SSL configuration for securing the embedded HTTP server.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, { "name": "camel.metrics.baseEndpointURIExchangeEventNotifier", "description": "Whether to use static or dynamic values for Endpoint Name tags in captured metrics. By default, static values are used. When using dynamic tags, then a dynamic to (toD) can compute many different endpoint URIs that, can lead to many tags as the URI is dynamic, so use this with care if setting this option to false.", "sourceType": "org.apache.camel.main.MetricsConfigurationProperties", "type": "boolean", " [...] { "name": "camel.metrics.binders", "description": "Additional Micrometer binders to include such as jvm-memory, processor, jvm-thread, and so forth. Multiple binders can be separated by comma. The following binders currently is available from Micrometer: class-loader, commons-object-pool2, file-descriptor, hystrix-metrics-binder, jvm-compilation, jvm-gc, jvm-heap-pressure, jvm-info, jvm-memory, jvm-thread, log4j2, logback, processor, uptime", "sourceType": "org.apache.camel.main.Metr [...] { "name": "camel.metrics.clearOnReload", "description": "Clear the captured metrics data when Camel is reloading routes such as when using Camel JBang.", "sourceType": "org.apache.camel.main.MetricsConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true }, @@ -277,22 +298,22 @@ { "name": "camel.server.authenticationEnabled", "description": "Whether to enable HTTP authentication for embedded server (for standalone applications; not Spring Boot or Quarkus).", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, { "name": "camel.server.authenticationPath", "description": "Set HTTP url path of embedded server that is protected by authentication configuration.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, { "name": "camel.server.basicPropertiesFile", "description": "Name of the file that contains basic authentication info for Vert.x file auth provider.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, - { "name": "camel.server.devConsoleEnabled", "description": "Whether to enable developer console (not intended for production use). Dev console must also be enabled on CamelContext. For example by setting camel.context.dev-console=true in application.properties, or via code camelContext.setDevConsole(true); If enabled then you can access a basic developer console on context-path: \/q\/dev.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "j [...] + { "name": "camel.server.devConsoleEnabled", "description": "Whether to enable developer console (not intended for production use). Dev console must also be enabled on CamelContext. For example by setting camel.context.dev-console=true in application.properties, or via code camelContext.setDevConsole(true); If enabled then you can access a basic developer console on context-path: \/q\/dev. Deprecated since 4.12.0, use HTTP management server instead.", "sourceType": "org.apache.camel.m [...] { "name": "camel.server.downloadEnabled", "description": "Whether to enable file download via HTTP. This makes it possible to browse and download resource source files such as Camel XML or YAML routes. Only enable this for development, troubleshooting or special situations for management and monitoring.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, { "name": "camel.server.enabled", "description": "Whether embedded HTTP server is enabled. By default, the server is not enabled.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, { "name": "camel.server.fileUploadDirectory", "description": "Directory to temporary store file uploads while Camel routes the incoming request. If no directory has been explicit configured, then a temporary directory is created in the java.io.tmpdir directory.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, { "name": "camel.server.fileUploadEnabled", "description": "Whether to enable file uploads being supported (such as POST multipart\/form-data) and stored into a temporary directory.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true }, - { "name": "camel.server.healthCheckEnabled", "description": "Whether to enable health-check console. If enabled then you can access health-check status on context-path: \/q\/health (default)", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, - { "name": "camel.server.healthPath", "description": "The path endpoint used to expose the health status", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/q\/health" }, + { "name": "camel.server.healthCheckEnabled", "description": "Whether to enable health-check console. If enabled then you can access health-check status on context-path: \/q\/health (default). Deprecated since 4.12.0, use HTTP management server instead.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.server.healthPath", "description": "The path endpoint used to expose the health status. Deprecated since 4.12.0, use HTTP management server instead.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/q\/health" }, { "name": "camel.server.host", "description": "Hostname to use for binding embedded HTTP server", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "0.0.0.0" }, - { "name": "camel.server.infoEnabled", "description": "Whether to enable info console. If enabled then you can see some basic Camel information at \/q\/info", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, - { "name": "camel.server.jolokiaEnabled", "description": "Whether to enable jolokia. If enabled then you can access jolokia api on context-path: \/q\/jolokia", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, - { "name": "camel.server.jolokiaPath", "description": "The path endpoint used to expose the jolokia data.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/q\/jolokia" }, + { "name": "camel.server.infoEnabled", "description": "Whether to enable info console. If enabled then you can see some basic Camel information at \/q\/info. Deprecated since 4.12.0, use HTTP management server instead.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.server.jolokiaEnabled", "description": "Whether to enable jolokia. If enabled then you can access jolokia api on context-path: \/q\/jolokia. Deprecated since 4.12.0, use HTTP management server instead.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.server.jolokiaPath", "description": "The path endpoint used to expose the jolokia data. Deprecated since 4.12.0, use HTTP management server instead.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/q\/jolokia" }, { "name": "camel.server.jwtKeystorePassword", "description": "Password from the keystore used for JWT tokens validation.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, { "name": "camel.server.jwtKeystorePath", "description": "Path to the keystore file used for JWT tokens validation.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, { "name": "camel.server.jwtKeystoreType", "description": "Type of the keystore used for JWT tokens validation (jks, pkcs12, etc.).", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, { "name": "camel.server.maxBodySize", "description": "Maximum HTTP body size the embedded HTTP server can accept.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "integer", "javaType": "java.lang.Long" }, - { "name": "camel.server.metricsEnabled", "description": "Whether to enable metrics. If enabled then you can access metrics on context-path: \/q\/metrics (default)", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.server.metricsEnabled", "description": "Whether to enable metrics. If enabled then you can access metrics on context-path: \/q\/metrics (default). Deprecated since 4.12.0, use HTTP management server instead.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, { "name": "camel.server.path", "description": "Context-path to use for embedded HTTP server", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/" }, { "name": "camel.server.port", "description": "Port to use for binding embedded HTTP server", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 8080 }, { "name": "camel.server.sendEnabled", "description": "Whether to enable sending messages to Camel via HTTP. This makes it possible to use Camel to send messages to Camel endpoint URIs via HTTP.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, diff --git a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/DefaultMainHttpServerFactory.java b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/DefaultMainHttpServerFactory.java index d907fe9e765..a435f174e28 100644 --- a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/DefaultMainHttpServerFactory.java +++ b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/DefaultMainHttpServerFactory.java @@ -21,6 +21,7 @@ import org.apache.camel.CamelContextAware; import org.apache.camel.Service; import org.apache.camel.component.platform.http.main.authentication.BasicAuthenticationConfigurer; import org.apache.camel.component.platform.http.main.authentication.JWTAuthenticationConfigurer; +import org.apache.camel.main.HttpManagementServerConfigurationProperties; import org.apache.camel.main.HttpServerConfigurationProperties; import org.apache.camel.main.MainConstants; import org.apache.camel.main.MainHttpServerFactory; @@ -88,6 +89,35 @@ public class DefaultMainHttpServerFactory implements CamelContextAware, MainHttp return server; } + @Override + public Service newHttpManagementServer( + CamelContext camelContext, HttpManagementServerConfigurationProperties configuration) { + MainHttpServer server = new MainHttpServer(); + + server.setCamelContext(camelContext); + server.setHost(configuration.getHost()); + server.setPort(configuration.getPort()); + server.setPath(configuration.getPath()); + if (configuration.getMaxBodySize() != null) { + server.setMaxBodySize(configuration.getMaxBodySize()); + } + server.setUseGlobalSslContextParameters(configuration.isUseGlobalSslContextParameters()); + server.setInfoEnabled(configuration.isInfoEnabled()); + server.setDevConsoleEnabled(configuration.isDevConsoleEnabled()); + server.setHealthCheckEnabled(configuration.isHealthCheckEnabled()); + server.setHealthPath(configuration.getHealthPath()); + server.setJolokiaEnabled(configuration.isJolokiaEnabled()); + server.setJolokiaPath(configuration.getJolokiaPath()); + server.setMetricsEnabled(configuration.isMetricsEnabled()); + server.setSendEnabled(configuration.isSendEnabled()); + + if (configuration.isAuthenticationEnabled()) { + configureAuthentication(server, configuration); + } + + return server; + } + private void configureAuthentication(MainHttpServer server, HttpServerConfigurationProperties configuration) { if (configuration.getBasicPropertiesFile() != null) { BasicAuthenticationConfigurer auth = new BasicAuthenticationConfigurer(); @@ -100,4 +130,16 @@ public class DefaultMainHttpServerFactory implements CamelContextAware, MainHttp } } + private void configureAuthentication(MainHttpServer server, HttpManagementServerConfigurationProperties configuration) { + if (configuration.getBasicPropertiesFile() != null) { + BasicAuthenticationConfigurer auth = new BasicAuthenticationConfigurer(); + auth.configureAuthentication(server.getConfiguration().getAuthenticationConfig(), configuration); + } else if (configuration.getJwtKeystoreType() != null) { + ObjectHelper.notNull(configuration.getJwtKeystorePath(), "jwtKeyStorePath"); + ObjectHelper.notNull(configuration.getJwtKeystorePassword(), "jwtKeyStorePassword"); + JWTAuthenticationConfigurer auth = new JWTAuthenticationConfigurer(); + auth.configureAuthentication(server.getConfiguration().getAuthenticationConfig(), configuration); + } + } + } diff --git a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/BasicAuthenticationConfigurer.java b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/BasicAuthenticationConfigurer.java index 6394e836d28..4c43f2e5f82 100644 --- a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/BasicAuthenticationConfigurer.java +++ b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/BasicAuthenticationConfigurer.java @@ -20,6 +20,7 @@ import io.vertx.ext.auth.properties.PropertyFileAuthentication; import io.vertx.ext.web.handler.BasicAuthHandler; import org.apache.camel.component.platform.http.vertx.auth.AuthenticationConfig; import org.apache.camel.component.platform.http.vertx.auth.AuthenticationConfig.AuthenticationConfigEntry; +import org.apache.camel.main.HttpManagementServerConfigurationProperties; import org.apache.camel.main.HttpServerConfigurationProperties; import static org.apache.camel.util.ObjectHelper.isEmpty; @@ -42,4 +43,21 @@ public class BasicAuthenticationConfigurer implements MainAuthenticationConfigur authenticationConfig.getEntries().add(entry); authenticationConfig.setEnabled(true); } + + @Override + public void configureAuthentication( + AuthenticationConfig authenticationConfig, + HttpManagementServerConfigurationProperties properties) { + String authPropertiesFileName = properties.getBasicPropertiesFile(); + String path = isEmpty(properties.getAuthenticationPath()) ? properties.getAuthenticationPath() : "/*"; + + AuthenticationConfigEntry entry = new AuthenticationConfigEntry(); + entry.setPath(path); + entry.setAuthenticationHandlerFactory(BasicAuthHandler::create); + entry.setAuthenticationProviderFactory( + vertx -> PropertyFileAuthentication.create(vertx, authPropertiesFileName)); + + authenticationConfig.getEntries().add(entry); + authenticationConfig.setEnabled(true); + } } diff --git a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/JWTAuthenticationConfigurer.java b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/JWTAuthenticationConfigurer.java index 02e82f1e41f..41bbdab45ab 100644 --- a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/JWTAuthenticationConfigurer.java +++ b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/JWTAuthenticationConfigurer.java @@ -25,6 +25,7 @@ import io.vertx.ext.web.handler.JWTAuthHandler; import org.apache.camel.component.platform.http.vertx.auth.AuthenticationConfig; import org.apache.camel.component.platform.http.vertx.auth.AuthenticationConfig.AuthenticationConfigEntry; import org.apache.camel.component.platform.http.vertx.auth.AuthenticationConfig.AuthenticationHandlerFactory; +import org.apache.camel.main.HttpManagementServerConfigurationProperties; import org.apache.camel.main.HttpServerConfigurationProperties; import static org.apache.camel.util.ObjectHelper.isEmpty; @@ -59,4 +60,33 @@ public class JWTAuthenticationConfigurer implements MainAuthenticationConfigurer authenticationConfig.getEntries().add(entry); authenticationConfig.setEnabled(true); } + + @Override + public void configureAuthentication( + AuthenticationConfig authenticationConfig, + HttpManagementServerConfigurationProperties properties) { + + String path = isEmpty(properties.getAuthenticationPath()) ? properties.getAuthenticationPath() : "/*"; + + AuthenticationConfigEntry entry = new AuthenticationConfigEntry(); + entry.setPath(path); + entry.setAuthenticationHandlerFactory(new AuthenticationHandlerFactory() { + @Override + public <T extends AuthenticationProvider> AuthenticationHandler createAuthenticationHandler( + T authenticationProvider) { + JWTAuth authProvider = (JWTAuth) authenticationProvider; + return JWTAuthHandler.create(authProvider); + } + }); + entry.setAuthenticationProviderFactory(vertx -> JWTAuth.create( + vertx, + new JWTAuthOptions( + new JsonObject().put("keyStore", new JsonObject() + .put("type", properties.getJwtKeystoreType()) + .put("path", properties.getJwtKeystorePath()) + .put("password", properties.getJwtKeystorePassword()))))); + + authenticationConfig.getEntries().add(entry); + authenticationConfig.setEnabled(true); + } } diff --git a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/MainAuthenticationConfigurer.java b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/MainAuthenticationConfigurer.java index 0460a3f62d6..72011adc379 100644 --- a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/MainAuthenticationConfigurer.java +++ b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/authentication/MainAuthenticationConfigurer.java @@ -17,6 +17,7 @@ package org.apache.camel.component.platform.http.main.authentication; import org.apache.camel.component.platform.http.vertx.auth.AuthenticationConfig; +import org.apache.camel.main.HttpManagementServerConfigurationProperties; import org.apache.camel.main.HttpServerConfigurationProperties; /** @@ -25,4 +26,8 @@ import org.apache.camel.main.HttpServerConfigurationProperties; public interface MainAuthenticationConfigurer { void configureAuthentication(AuthenticationConfig authenticationConfig, HttpServerConfigurationProperties properties); + + void configureAuthentication( + AuthenticationConfig authenticationConfig, HttpManagementServerConfigurationProperties properties); + } diff --git a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpRouter.java b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpRouter.java index 9fa653ee676..45893b60335 100644 --- a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpRouter.java +++ b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpRouter.java @@ -299,6 +299,18 @@ public class VertxPlatformHttpRouter implements Router { VertxPlatformHttpRouter.class); } + @Deprecated + /** + * Default router lookup method. Used for backward compatibility only. You should instead use @lookup(CamelContext, + * String) + * + * @param camelContext + * @return the default port router + */ + public static VertxPlatformHttpRouter lookup(CamelContext camelContext) { + return lookup(camelContext, getRouterNameFromPort(8080)); + } + public static String getRouterNameFromPort(int port) { return VertxPlatformHttpRouter.PLATFORM_HTTP_ROUTER_NAME + "-" + port; } diff --git a/core/camel-main/src/generated/java/org/apache/camel/main/HttpManagementServerConfigurationPropertiesConfigurer.java b/core/camel-main/src/generated/java/org/apache/camel/main/HttpManagementServerConfigurationPropertiesConfigurer.java new file mode 100644 index 00000000000..93bb9e9fb68 --- /dev/null +++ b/core/camel-main/src/generated/java/org/apache/camel/main/HttpManagementServerConfigurationPropertiesConfigurer.java @@ -0,0 +1,184 @@ +/* Generated by camel build tools - do NOT edit this file! */ +package org.apache.camel.main; + +import javax.annotation.processing.Generated; +import java.util.Map; + +import org.apache.camel.CamelContext; +import org.apache.camel.spi.ExtendedPropertyConfigurerGetter; +import org.apache.camel.spi.PropertyConfigurerGetter; +import org.apache.camel.spi.ConfigurerStrategy; +import org.apache.camel.spi.GeneratedPropertyConfigurer; +import org.apache.camel.util.CaseInsensitiveMap; +import org.apache.camel.main.HttpManagementServerConfigurationProperties; + +/** + * Generated by camel build tools - do NOT edit this file! + */ +@Generated("org.apache.camel.maven.packaging.GenerateConfigurerMojo") +@SuppressWarnings("unchecked") +public class HttpManagementServerConfigurationPropertiesConfigurer extends org.apache.camel.support.component.PropertyConfigurerSupport implements GeneratedPropertyConfigurer, ExtendedPropertyConfigurerGetter { + + private static final Map<String, Object> ALL_OPTIONS; + static { + Map<String, Object> map = new CaseInsensitiveMap(); + map.put("AuthenticationEnabled", boolean.class); + map.put("AuthenticationPath", java.lang.String.class); + map.put("BasicPropertiesFile", java.lang.String.class); + map.put("DevConsoleEnabled", boolean.class); + map.put("Enabled", boolean.class); + map.put("HealthCheckEnabled", boolean.class); + map.put("HealthPath", java.lang.String.class); + map.put("Host", java.lang.String.class); + map.put("InfoEnabled", boolean.class); + map.put("JolokiaEnabled", boolean.class); + map.put("JolokiaPath", java.lang.String.class); + map.put("JwtKeystorePassword", java.lang.String.class); + map.put("JwtKeystorePath", java.lang.String.class); + map.put("JwtKeystoreType", java.lang.String.class); + map.put("MaxBodySize", java.lang.Long.class); + map.put("MetricsEnabled", boolean.class); + map.put("Path", java.lang.String.class); + map.put("Port", int.class); + map.put("SendEnabled", boolean.class); + map.put("UseGlobalSslContextParameters", boolean.class); + ALL_OPTIONS = map; + } + + @Override + public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) { + org.apache.camel.main.HttpManagementServerConfigurationProperties target = (org.apache.camel.main.HttpManagementServerConfigurationProperties) obj; + switch (ignoreCase ? name.toLowerCase() : name) { + case "authenticationenabled": + case "authenticationEnabled": target.setAuthenticationEnabled(property(camelContext, boolean.class, value)); return true; + case "authenticationpath": + case "authenticationPath": target.setAuthenticationPath(property(camelContext, java.lang.String.class, value)); return true; + case "basicpropertiesfile": + case "basicPropertiesFile": target.setBasicPropertiesFile(property(camelContext, java.lang.String.class, value)); return true; + case "devconsoleenabled": + case "devConsoleEnabled": target.setDevConsoleEnabled(property(camelContext, boolean.class, value)); return true; + case "enabled": target.setEnabled(property(camelContext, boolean.class, value)); return true; + case "healthcheckenabled": + case "healthCheckEnabled": target.setHealthCheckEnabled(property(camelContext, boolean.class, value)); return true; + case "healthpath": + case "healthPath": target.setHealthPath(property(camelContext, java.lang.String.class, value)); return true; + case "host": target.setHost(property(camelContext, java.lang.String.class, value)); return true; + case "infoenabled": + case "infoEnabled": target.setInfoEnabled(property(camelContext, boolean.class, value)); return true; + case "jolokiaenabled": + case "jolokiaEnabled": target.setJolokiaEnabled(property(camelContext, boolean.class, value)); return true; + case "jolokiapath": + case "jolokiaPath": target.setJolokiaPath(property(camelContext, java.lang.String.class, value)); return true; + case "jwtkeystorepassword": + case "jwtKeystorePassword": target.setJwtKeystorePassword(property(camelContext, java.lang.String.class, value)); return true; + case "jwtkeystorepath": + case "jwtKeystorePath": target.setJwtKeystorePath(property(camelContext, java.lang.String.class, value)); return true; + case "jwtkeystoretype": + case "jwtKeystoreType": target.setJwtKeystoreType(property(camelContext, java.lang.String.class, value)); return true; + case "maxbodysize": + case "maxBodySize": target.setMaxBodySize(property(camelContext, java.lang.Long.class, value)); return true; + case "metricsenabled": + case "metricsEnabled": target.setMetricsEnabled(property(camelContext, boolean.class, value)); return true; + case "path": target.setPath(property(camelContext, java.lang.String.class, value)); return true; + case "port": target.setPort(property(camelContext, int.class, value)); return true; + case "sendenabled": + case "sendEnabled": target.setSendEnabled(property(camelContext, boolean.class, value)); return true; + case "useglobalsslcontextparameters": + case "useGlobalSslContextParameters": target.setUseGlobalSslContextParameters(property(camelContext, boolean.class, value)); return true; + default: return false; + } + } + + @Override + public Map<String, Object> getAllOptions(Object target) { + return ALL_OPTIONS; + } + + @Override + public Class<?> getOptionType(String name, boolean ignoreCase) { + switch (ignoreCase ? name.toLowerCase() : name) { + case "authenticationenabled": + case "authenticationEnabled": return boolean.class; + case "authenticationpath": + case "authenticationPath": return java.lang.String.class; + case "basicpropertiesfile": + case "basicPropertiesFile": return java.lang.String.class; + case "devconsoleenabled": + case "devConsoleEnabled": return boolean.class; + case "enabled": return boolean.class; + case "healthcheckenabled": + case "healthCheckEnabled": return boolean.class; + case "healthpath": + case "healthPath": return java.lang.String.class; + case "host": return java.lang.String.class; + case "infoenabled": + case "infoEnabled": return boolean.class; + case "jolokiaenabled": + case "jolokiaEnabled": return boolean.class; + case "jolokiapath": + case "jolokiaPath": return java.lang.String.class; + case "jwtkeystorepassword": + case "jwtKeystorePassword": return java.lang.String.class; + case "jwtkeystorepath": + case "jwtKeystorePath": return java.lang.String.class; + case "jwtkeystoretype": + case "jwtKeystoreType": return java.lang.String.class; + case "maxbodysize": + case "maxBodySize": return java.lang.Long.class; + case "metricsenabled": + case "metricsEnabled": return boolean.class; + case "path": return java.lang.String.class; + case "port": return int.class; + case "sendenabled": + case "sendEnabled": return boolean.class; + case "useglobalsslcontextparameters": + case "useGlobalSslContextParameters": return boolean.class; + default: return null; + } + } + + @Override + public Object getOptionValue(Object obj, String name, boolean ignoreCase) { + org.apache.camel.main.HttpManagementServerConfigurationProperties target = (org.apache.camel.main.HttpManagementServerConfigurationProperties) obj; + switch (ignoreCase ? name.toLowerCase() : name) { + case "authenticationenabled": + case "authenticationEnabled": return target.isAuthenticationEnabled(); + case "authenticationpath": + case "authenticationPath": return target.getAuthenticationPath(); + case "basicpropertiesfile": + case "basicPropertiesFile": return target.getBasicPropertiesFile(); + case "devconsoleenabled": + case "devConsoleEnabled": return target.isDevConsoleEnabled(); + case "enabled": return target.isEnabled(); + case "healthcheckenabled": + case "healthCheckEnabled": return target.isHealthCheckEnabled(); + case "healthpath": + case "healthPath": return target.getHealthPath(); + case "host": return target.getHost(); + case "infoenabled": + case "infoEnabled": return target.isInfoEnabled(); + case "jolokiaenabled": + case "jolokiaEnabled": return target.isJolokiaEnabled(); + case "jolokiapath": + case "jolokiaPath": return target.getJolokiaPath(); + case "jwtkeystorepassword": + case "jwtKeystorePassword": return target.getJwtKeystorePassword(); + case "jwtkeystorepath": + case "jwtKeystorePath": return target.getJwtKeystorePath(); + case "jwtkeystoretype": + case "jwtKeystoreType": return target.getJwtKeystoreType(); + case "maxbodysize": + case "maxBodySize": return target.getMaxBodySize(); + case "metricsenabled": + case "metricsEnabled": return target.isMetricsEnabled(); + case "path": return target.getPath(); + case "port": return target.getPort(); + case "sendenabled": + case "sendEnabled": return target.isSendEnabled(); + case "useglobalsslcontextparameters": + case "useGlobalSslContextParameters": return target.isUseGlobalSslContextParameters(); + default: return null; + } + } +} + diff --git a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json index 54457232325..760a8ac8c24 100644 --- a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json +++ b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json @@ -4,6 +4,7 @@ { "name": "camel.startupcondition", "description": "Camel Startup Condition configurations", "sourceType": "org.apache.camel.main.StartupConditionConfigurationProperties" }, { "name": "camel.routecontroller", "description": "Camel Route Controller configurations", "sourceType": "org.apache.camel.main.RouteControllerConfigurationProperties" }, { "name": "camel.server", "description": "Camel Embedded HTTP Server (only for standalone; not Spring Boot or Quarkus) configurations", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties" }, + { "name": "camel.management.server", "description": "Camel Embedded HTTP management Server (only for standalone; not Spring Boot or Quarkus) configurations", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties" }, { "name": "camel.debug", "description": "Camel Debugger configurations", "sourceType": "org.apache.camel.main.DebuggerConfigurationProperties" }, { "name": "camel.trace", "description": "Camel Tracer configurations", "sourceType": "org.apache.camel.main.TracerConfigurationProperties" }, { "name": "camel.ssl", "description": "Camel SSL configurations", "sourceType": "org.apache.camel.main.SSLConfigurationProperties" }, @@ -189,6 +190,26 @@ { "name": "camel.lra.enabled", "description": "To enable Saga LRA", "sourceType": "org.apache.camel.main.LraConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": false }, { "name": "camel.lra.localParticipantContextPath", "description": "The context-path for the local participant. Is default \/lra-participant", "sourceType": "org.apache.camel.main.LraConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/lra-participant" }, { "name": "camel.lra.localParticipantUrl", "description": "The URL for the local participant", "sourceType": "org.apache.camel.main.LraConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, + { "name": "camel.management.server.authenticationEnabled", "description": "Whether to enable HTTP authentication for embedded server (for standalone applications; not Spring Boot or Quarkus).", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.management.server.authenticationPath", "description": "Set HTTP url path of embedded server that is protected by authentication configuration.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, + { "name": "camel.management.server.basicPropertiesFile", "description": "Name of the file that contains basic authentication info for Vert.x file auth provider.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, + { "name": "camel.management.server.devConsoleEnabled", "description": "Whether to enable developer console (not intended for production use). Dev console must also be enabled on CamelContext. For example by setting camel.context.dev-console=true in application.properties, or via code camelContext.setDevConsole(true); If enabled then you can access a basic developer console on context-path: \/q\/dev.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", [...] + { "name": "camel.management.server.enabled", "description": "Whether embedded HTTP server is enabled. By default, the server is not enabled.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.management.server.healthCheckEnabled", "description": "Whether to enable health-check console. If enabled then you can access health-check status on context-path: \/q\/health (default)", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.management.server.healthPath", "description": "The path endpoint used to expose the health status", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/observe\/health" }, + { "name": "camel.management.server.host", "description": "Hostname to use for binding embedded HTTP server", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "0.0.0.0" }, + { "name": "camel.management.server.infoEnabled", "description": "Whether to enable info console. If enabled then you can see some basic Camel information at \/q\/info", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.management.server.jolokiaEnabled", "description": "Whether to enable jolokia. If enabled then you can access jolokia api on context-path: \/q\/jolokia", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.management.server.jolokiaPath", "description": "The path endpoint used to expose the jolokia data.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/observe\/jolokia" }, + { "name": "camel.management.server.jwtKeystorePassword", "description": "Password from the keystore used for JWT tokens validation.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, + { "name": "camel.management.server.jwtKeystorePath", "description": "Path to the keystore file used for JWT tokens validation.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, + { "name": "camel.management.server.jwtKeystoreType", "description": "Type of the keystore used for JWT tokens validation (jks, pkcs12, etc.).", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, + { "name": "camel.management.server.maxBodySize", "description": "Maximum HTTP body size the embedded HTTP server can accept.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "integer", "javaType": "java.lang.Long" }, + { "name": "camel.management.server.metricsEnabled", "description": "Whether to enable metrics. If enabled then you can access metrics on context-path: \/q\/metrics (default)", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.management.server.path", "description": "Context-path to use for embedded HTTP server", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/" }, + { "name": "camel.management.server.port", "description": "Port to use for binding embedded HTTP server", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 9876 }, + { "name": "camel.management.server.sendEnabled", "description": "Whether to enable sending messages to Camel via HTTP. This makes it possible to use Camel to send messages to Camel endpoint URIs via HTTP.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.management.server.useGlobalSslContextParameters", "description": "Whether to use global SSL configuration for securing the embedded HTTP server.", "sourceType": "org.apache.camel.main.HttpManagementServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, { "name": "camel.metrics.baseEndpointURIExchangeEventNotifier", "description": "Whether to use static or dynamic values for Endpoint Name tags in captured metrics. By default, static values are used. When using dynamic tags, then a dynamic to (toD) can compute many different endpoint URIs that, can lead to many tags as the URI is dynamic, so use this with care if setting this option to false.", "sourceType": "org.apache.camel.main.MetricsConfigurationProperties", "type": "boolean", " [...] { "name": "camel.metrics.binders", "description": "Additional Micrometer binders to include such as jvm-memory, processor, jvm-thread, and so forth. Multiple binders can be separated by comma. The following binders currently is available from Micrometer: class-loader, commons-object-pool2, file-descriptor, hystrix-metrics-binder, jvm-compilation, jvm-gc, jvm-heap-pressure, jvm-info, jvm-memory, jvm-thread, log4j2, logback, processor, uptime", "sourceType": "org.apache.camel.main.Metr [...] { "name": "camel.metrics.clearOnReload", "description": "Clear the captured metrics data when Camel is reloading routes such as when using Camel JBang.", "sourceType": "org.apache.camel.main.MetricsConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true }, @@ -277,22 +298,22 @@ { "name": "camel.server.authenticationEnabled", "description": "Whether to enable HTTP authentication for embedded server (for standalone applications; not Spring Boot or Quarkus).", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, { "name": "camel.server.authenticationPath", "description": "Set HTTP url path of embedded server that is protected by authentication configuration.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, { "name": "camel.server.basicPropertiesFile", "description": "Name of the file that contains basic authentication info for Vert.x file auth provider.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, - { "name": "camel.server.devConsoleEnabled", "description": "Whether to enable developer console (not intended for production use). Dev console must also be enabled on CamelContext. For example by setting camel.context.dev-console=true in application.properties, or via code camelContext.setDevConsole(true); If enabled then you can access a basic developer console on context-path: \/q\/dev.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "j [...] + { "name": "camel.server.devConsoleEnabled", "description": "Whether to enable developer console (not intended for production use). Dev console must also be enabled on CamelContext. For example by setting camel.context.dev-console=true in application.properties, or via code camelContext.setDevConsole(true); If enabled then you can access a basic developer console on context-path: \/q\/dev. Deprecated since 4.12.0, use HTTP management server instead.", "sourceType": "org.apache.camel.m [...] { "name": "camel.server.downloadEnabled", "description": "Whether to enable file download via HTTP. This makes it possible to browse and download resource source files such as Camel XML or YAML routes. Only enable this for development, troubleshooting or special situations for management and monitoring.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, { "name": "camel.server.enabled", "description": "Whether embedded HTTP server is enabled. By default, the server is not enabled.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, { "name": "camel.server.fileUploadDirectory", "description": "Directory to temporary store file uploads while Camel routes the incoming request. If no directory has been explicit configured, then a temporary directory is created in the java.io.tmpdir directory.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, { "name": "camel.server.fileUploadEnabled", "description": "Whether to enable file uploads being supported (such as POST multipart\/form-data) and stored into a temporary directory.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": true }, - { "name": "camel.server.healthCheckEnabled", "description": "Whether to enable health-check console. If enabled then you can access health-check status on context-path: \/q\/health (default)", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, - { "name": "camel.server.healthPath", "description": "The path endpoint used to expose the health status", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/q\/health" }, + { "name": "camel.server.healthCheckEnabled", "description": "Whether to enable health-check console. If enabled then you can access health-check status on context-path: \/q\/health (default). Deprecated since 4.12.0, use HTTP management server instead.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.server.healthPath", "description": "The path endpoint used to expose the health status. Deprecated since 4.12.0, use HTTP management server instead.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/q\/health" }, { "name": "camel.server.host", "description": "Hostname to use for binding embedded HTTP server", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "0.0.0.0" }, - { "name": "camel.server.infoEnabled", "description": "Whether to enable info console. If enabled then you can see some basic Camel information at \/q\/info", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, - { "name": "camel.server.jolokiaEnabled", "description": "Whether to enable jolokia. If enabled then you can access jolokia api on context-path: \/q\/jolokia", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, - { "name": "camel.server.jolokiaPath", "description": "The path endpoint used to expose the jolokia data.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/q\/jolokia" }, + { "name": "camel.server.infoEnabled", "description": "Whether to enable info console. If enabled then you can see some basic Camel information at \/q\/info. Deprecated since 4.12.0, use HTTP management server instead.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.server.jolokiaEnabled", "description": "Whether to enable jolokia. If enabled then you can access jolokia api on context-path: \/q\/jolokia. Deprecated since 4.12.0, use HTTP management server instead.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.server.jolokiaPath", "description": "The path endpoint used to expose the jolokia data. Deprecated since 4.12.0, use HTTP management server instead.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/q\/jolokia" }, { "name": "camel.server.jwtKeystorePassword", "description": "Password from the keystore used for JWT tokens validation.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, { "name": "camel.server.jwtKeystorePath", "description": "Path to the keystore file used for JWT tokens validation.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, { "name": "camel.server.jwtKeystoreType", "description": "Type of the keystore used for JWT tokens validation (jks, pkcs12, etc.).", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String" }, { "name": "camel.server.maxBodySize", "description": "Maximum HTTP body size the embedded HTTP server can accept.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "integer", "javaType": "java.lang.Long" }, - { "name": "camel.server.metricsEnabled", "description": "Whether to enable metrics. If enabled then you can access metrics on context-path: \/q\/metrics (default)", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, + { "name": "camel.server.metricsEnabled", "description": "Whether to enable metrics. If enabled then you can access metrics on context-path: \/q\/metrics (default). Deprecated since 4.12.0, use HTTP management server instead.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, { "name": "camel.server.path", "description": "Context-path to use for embedded HTTP server", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "string", "javaType": "java.lang.String", "defaultValue": "\/" }, { "name": "camel.server.port", "description": "Port to use for binding embedded HTTP server", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "integer", "javaType": "int", "defaultValue": 8080 }, { "name": "camel.server.sendEnabled", "description": "Whether to enable sending messages to Camel via HTTP. This makes it possible to use Camel to send messages to Camel endpoint URIs via HTTP.", "sourceType": "org.apache.camel.main.HttpServerConfigurationProperties", "type": "boolean", "javaType": "boolean", "defaultValue": "false" }, diff --git a/core/camel-main/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.main.HttpManagementServerConfigurationProperties b/core/camel-main/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.main.HttpManagementServerConfigurationProperties new file mode 100644 index 00000000000..4948612e4e4 --- /dev/null +++ b/core/camel-main/src/generated/resources/META-INF/services/org/apache/camel/configurer/org.apache.camel.main.HttpManagementServerConfigurationProperties @@ -0,0 +1,2 @@ +# Generated by camel build tools - do NOT edit this file! +class=org.apache.camel.main.HttpManagementServerConfigurationPropertiesConfigurer diff --git a/core/camel-main/src/main/docs/main.adoc b/core/camel-main/src/main/docs/main.adoc index 17b2821a896..8d544da22c4 100644 --- a/core/camel-main/src/main/docs/main.adoc +++ b/core/camel-main/src/main/docs/main.adoc @@ -195,22 +195,22 @@ The camel.server supports 28 options, which are listed below. | *camel.server.authentication{zwsp}Enabled* | Whether to enable HTTP authentication for embedded server (for standalone applications; not Spring Boot or Quarkus). | false | boolean | *camel.server.authentication{zwsp}Path* | Set HTTP url path of embedded server that is protected by authentication configuration. | | String | *camel.server.basicProperties{zwsp}File* | Name of the file that contains basic authentication info for Vert.x file auth provider. | | String -| *camel.server.devConsoleEnabled* | Whether to enable developer console (not intended for production use). Dev console must also be enabled on CamelContext. For example by setting camel.context.dev-console=true in application.properties, or via code camelContext.setDevConsole(true); If enabled then you can access a basic developer console on context-path: /q/dev. | false | boolean +| *camel.server.devConsoleEnabled* | Whether to enable developer console (not intended for production use). Dev console must also be enabled on CamelContext. For example by setting camel.context.dev-console=true in application.properties, or via code camelContext.setDevConsole(true); If enabled then you can access a basic developer console on context-path: /q/dev. Deprecated since 4.12.0, use HTTP management server instead. | false | boolean | *camel.server.downloadEnabled* | Whether to enable file download via HTTP. This makes it possible to browse and download resource source files such as Camel XML or YAML routes. Only enable this for development, troubleshooting or special situations for management and monitoring. | false | boolean | *camel.server.enabled* | Whether embedded HTTP server is enabled. By default, the server is not enabled. | false | boolean | *camel.server.fileUpload{zwsp}Directory* | Directory to temporary store file uploads while Camel routes the incoming request. If no directory has been explicit configured, then a temporary directory is created in the java.io.tmpdir directory. | | String | *camel.server.fileUploadEnabled* | Whether to enable file uploads being supported (such as POST multipart/form-data) and stored into a temporary directory. | true | boolean -| *camel.server.healthCheck{zwsp}Enabled* | Whether to enable health-check console. If enabled then you can access health-check status on context-path: /q/health (default) | false | boolean -| *camel.server.healthPath* | The path endpoint used to expose the health status | /q/health | String +| *camel.server.healthCheck{zwsp}Enabled* | Whether to enable health-check console. If enabled then you can access health-check status on context-path: /q/health (default). Deprecated since 4.12.0, use HTTP management server instead. | false | boolean +| *camel.server.healthPath* | The path endpoint used to expose the health status. Deprecated since 4.12.0, use HTTP management server instead. | /q/health | String | *camel.server.host* | Hostname to use for binding embedded HTTP server | 0.0.0.0 | String -| *camel.server.infoEnabled* | Whether to enable info console. If enabled then you can see some basic Camel information at /q/info | false | boolean -| *camel.server.jolokiaEnabled* | Whether to enable jolokia. If enabled then you can access jolokia api on context-path: /q/jolokia | false | boolean -| *camel.server.jolokiaPath* | The path endpoint used to expose the jolokia data. | /q/jolokia | String +| *camel.server.infoEnabled* | Whether to enable info console. If enabled then you can see some basic Camel information at /q/info. Deprecated since 4.12.0, use HTTP management server instead. | false | boolean +| *camel.server.jolokiaEnabled* | Whether to enable jolokia. If enabled then you can access jolokia api on context-path: /q/jolokia. Deprecated since 4.12.0, use HTTP management server instead. | false | boolean +| *camel.server.jolokiaPath* | The path endpoint used to expose the jolokia data. Deprecated since 4.12.0, use HTTP management server instead. | /q/jolokia | String | *camel.server.jwtKeystore{zwsp}Password* | Password from the keystore used for JWT tokens validation. | | String | *camel.server.jwtKeystorePath* | Path to the keystore file used for JWT tokens validation. | | String | *camel.server.jwtKeystoreType* | Type of the keystore used for JWT tokens validation (jks, pkcs12, etc.). | | String | *camel.server.maxBodySize* | Maximum HTTP body size the embedded HTTP server can accept. | | Long -| *camel.server.metricsEnabled* | Whether to enable metrics. If enabled then you can access metrics on context-path: /q/metrics (default) | false | boolean +| *camel.server.metricsEnabled* | Whether to enable metrics. If enabled then you can access metrics on context-path: /q/metrics (default). Deprecated since 4.12.0, use HTTP management server instead. | false | boolean | *camel.server.path* | Context-path to use for embedded HTTP server | / | String | *camel.server.port* | Port to use for binding embedded HTTP server | 8080 | int | *camel.server.sendEnabled* | Whether to enable sending messages to Camel via HTTP. This makes it possible to use Camel to send messages to Camel endpoint URIs via HTTP. | false | boolean @@ -223,6 +223,35 @@ The camel.server supports 28 options, which are listed below. |=== +=== Camel Embedded HTTP management Server (only for standalone; not Spring Boot or Quarkus) configurations +The camel.management.server supports 20 options, which are listed below. + +[width="100%",cols="2,5,^1,2",options="header"] +|=== +| Name | Description | Default | Type +| *camel.management.server.authentication{zwsp}Enabled* | Whether to enable HTTP authentication for embedded server (for standalone applications; not Spring Boot or Quarkus). | false | boolean +| *camel.management.server.authentication{zwsp}Path* | Set HTTP url path of embedded server that is protected by authentication configuration. | | String +| *camel.management.server.basic{zwsp}PropertiesFile* | Name of the file that contains basic authentication info for Vert.x file auth provider. | | String +| *camel.management.server.dev{zwsp}ConsoleEnabled* | Whether to enable developer console (not intended for production use). Dev console must also be enabled on CamelContext. For example by setting camel.context.dev-console=true in application.properties, or via code camelContext.setDevConsole(true); If enabled then you can access a basic developer console on context-path: /q/dev. | false | boolean +| *camel.management.server.enabled* | Whether embedded HTTP server is enabled. By default, the server is not enabled. | false | boolean +| *camel.management.server.health{zwsp}CheckEnabled* | Whether to enable health-check console. If enabled then you can access health-check status on context-path: /q/health (default) | false | boolean +| *camel.management.server.health{zwsp}Path* | The path endpoint used to expose the health status | /observe/health | String +| *camel.management.server.host* | Hostname to use for binding embedded HTTP server | 0.0.0.0 | String +| *camel.management.server.info{zwsp}Enabled* | Whether to enable info console. If enabled then you can see some basic Camel information at /q/info | false | boolean +| *camel.management.server.jolokia{zwsp}Enabled* | Whether to enable jolokia. If enabled then you can access jolokia api on context-path: /q/jolokia | false | boolean +| *camel.management.server.jolokia{zwsp}Path* | The path endpoint used to expose the jolokia data. | /observe/jolokia | String +| *camel.management.server.jwt{zwsp}KeystorePassword* | Password from the keystore used for JWT tokens validation. | | String +| *camel.management.server.jwt{zwsp}KeystorePath* | Path to the keystore file used for JWT tokens validation. | | String +| *camel.management.server.jwt{zwsp}KeystoreType* | Type of the keystore used for JWT tokens validation (jks, pkcs12, etc.). | | String +| *camel.management.server.max{zwsp}BodySize* | Maximum HTTP body size the embedded HTTP server can accept. | | Long +| *camel.management.server.metrics{zwsp}Enabled* | Whether to enable metrics. If enabled then you can access metrics on context-path: /q/metrics (default) | false | boolean +| *camel.management.server.path* | Context-path to use for embedded HTTP server | / | String +| *camel.management.server.port* | Port to use for binding embedded HTTP server | 9876 | int +| *camel.management.server.send{zwsp}Enabled* | Whether to enable sending messages to Camel via HTTP. This makes it possible to use Camel to send messages to Camel endpoint URIs via HTTP. | false | boolean +| *camel.management.server.use{zwsp}GlobalSslContextParameters* | Whether to use global SSL configuration for securing the embedded HTTP server. | false | boolean +|=== + + === Camel Debugger configurations The camel.debug supports 15 options, which are listed below. diff --git a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java index 2505843ddef..01aef42405a 100644 --- a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java +++ b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java @@ -136,7 +136,7 @@ public abstract class BaseMainSupport extends BaseService { "camel.context.", "camel.resilience4j.", "camel.faulttolerance.", "camel.rest.", "camel.vault.", "camel.threadpool.", "camel.health.", "camel.lra.", "camel.opentelemetry2.", "camel.opentelemetry.", - "camel.telemetryDev.", "camel.metrics.", "camel.routeTemplate", + "camel.telemetryDev.", "camel.management.server.", "camel.metrics.", "camel.routeTemplate", "camel.devConsole.", "camel.variable.", "camel.beans.", "camel.globalOptions.", "camel.server.", "camel.ssl.", "camel.debug.", "camel.trace.", "camel.routeController." }; @@ -1263,6 +1263,7 @@ public abstract class BaseMainSupport extends BaseService { OrderedLocationProperties devConsoleProperties = new OrderedLocationProperties(); OrderedLocationProperties globalOptions = new OrderedLocationProperties(); OrderedLocationProperties httpServerProperties = new OrderedLocationProperties(); + OrderedLocationProperties httpManagementServerProperties = new OrderedLocationProperties(); OrderedLocationProperties sslProperties = new OrderedLocationProperties(); OrderedLocationProperties debuggerProperties = new OrderedLocationProperties(); OrderedLocationProperties tracerProperties = new OrderedLocationProperties(); @@ -1372,6 +1373,12 @@ public abstract class BaseMainSupport extends BaseService { String option = key.substring(13); validateOptionAndValue(key, option, value); httpServerProperties.put(loc, optionKey(option), value); + } else if (startsWithIgnoreCase(key, "camel.management.server.")) { + // grab the value + String value = prop.getProperty(key); + String option = key.substring(24); + validateOptionAndValue(key, option, value); + httpManagementServerProperties.put(loc, optionKey(option), value); } else if (startsWithIgnoreCase(key, "camel.ssl.")) { // grab the value String value = prop.getProperty(key); @@ -1439,6 +1446,13 @@ public abstract class BaseMainSupport extends BaseService { mainConfigurationProperties.isAutoConfigurationFailFast(), autoConfiguredProperties); } + if (!httpManagementServerProperties.isEmpty() || mainConfigurationProperties.hasHttpManagementServerConfiguration()) { + LOG.debug("Auto-configuring HTTP Management Server from loaded properties: {}", + httpManagementServerProperties.size()); + setHttpManagementServerProperties(camelContext, httpManagementServerProperties, + mainConfigurationProperties.isAutoConfigurationFailFast(), + autoConfiguredProperties); + } if (!threadPoolProperties.isEmpty() || mainConfigurationProperties.hasThreadPoolConfiguration()) { LOG.debug("Auto-configuring Thread Pool from loaded properties: {}", threadPoolProperties.size()); MainSupportModelConfigurer.setThreadPoolProperties(camelContext, mainConfigurationProperties, threadPoolProperties, @@ -1609,6 +1623,11 @@ public abstract class BaseMainSupport extends BaseService { LOG.warn("Property not auto-configured: camel.server.{}={}", k, v); }); } + if (!httpManagementServerProperties.isEmpty()) { + httpManagementServerProperties.forEach((k, v) -> { + LOG.warn("Property not auto-configured: camel.management.server.{}={}", k, v); + }); + } // and call after all properties are set DefaultConfigurationConfigurer.afterPropertiesSet(camelContext); @@ -1886,8 +1905,6 @@ public abstract class BaseMainSupport extends BaseService { return; } - System.out.println("********* Starting server on port " + server.getPort()); - // auto-detect camel-platform-http-main on classpath MainHttpServerFactory sf = resolveMainHttpServerFactory(camelContext); // create http server as a service managed by camel context @@ -1895,14 +1912,30 @@ public abstract class BaseMainSupport extends BaseService { // force eager starting as embedded http server is used for // container platform to check readiness and need to be started eager camelContext.addService(http, true, true); + } + + private void setHttpManagementServerProperties( + CamelContext camelContext, OrderedLocationProperties properties, + boolean failIfNotSet, OrderedLocationProperties autoConfiguredProperties) + throws Exception { + + HttpManagementServerConfigurationProperties server = mainConfigurationProperties.httpManagementServer(); - // TODO just test POC - HttpServerConfigurationProperties server2 = mainConfigurationProperties.httpServer(); - setPropertiesOnTarget(camelContext, server2, properties, "camel.server.", + setPropertiesOnTarget(camelContext, server, properties, "camel.management.server.", mainConfigurationProperties.isAutoConfigurationFailFast(), true, autoConfiguredProperties); - server2.setPort(9876); - Service http2 = sf.newHttpServer(camelContext, server2); - camelContext.addService(http2, true, true); + + if (!server.isEnabled()) { + // http management server is disabled + return; + } + + // auto-detect camel-platform-http-main on classpath + MainHttpServerFactory sf = resolveMainHttpServerFactory(camelContext); + // create http management server as a service managed by camel context + Service http = sf.newHttpManagementServer(camelContext, server); + // force eager starting as embedded http management server is used for + // container platform to check readiness and need to be started eager + camelContext.addService(http, true, true); } private void setVaultProperties( diff --git a/core/camel-main/src/main/java/org/apache/camel/main/HttpServerConfigurationProperties.java b/core/camel-main/src/main/java/org/apache/camel/main/HttpManagementServerConfigurationProperties.java similarity index 54% copy from core/camel-main/src/main/java/org/apache/camel/main/HttpServerConfigurationProperties.java copy to core/camel-main/src/main/java/org/apache/camel/main/HttpManagementServerConfigurationProperties.java index ffb959d97df..521a4be8197 100644 --- a/core/camel-main/src/main/java/org/apache/camel/main/HttpServerConfigurationProperties.java +++ b/core/camel-main/src/main/java/org/apache/camel/main/HttpManagementServerConfigurationProperties.java @@ -21,10 +21,10 @@ import org.apache.camel.spi.Configurer; import org.apache.camel.spi.Metadata; /** - * Configuration for embedded HTTP server for standalone Camel applications (not Spring Boot / Quarkus). + * Configuration for embedded HTTP management server for standalone Camel applications (not Spring Boot / Quarkus). */ @Configurer(extended = true) -public class HttpServerConfigurationProperties implements BootstrapCloseable { +public class HttpManagementServerConfigurationProperties implements BootstrapCloseable { private MainConfigurationProperties parent; @@ -32,28 +32,17 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { private boolean enabled; @Metadata(defaultValue = "0.0.0.0") private String host = "0.0.0.0"; - @Metadata(defaultValue = "8080") - private int port = 8080; + @Metadata(defaultValue = "9876") + private int port = 9876; @Metadata(defaultValue = "/") private String path = "/"; private Long maxBodySize; private boolean useGlobalSslContextParameters; - @Metadata(defaultValue = "true") - private boolean fileUploadEnabled = true; - @Metadata - private String fileUploadDirectory; private boolean infoEnabled; - private boolean staticEnabled; - private String staticSourceDir; - @Metadata(defaultValue = "/") - private String staticContextPath = "/"; private boolean devConsoleEnabled; private boolean healthCheckEnabled; private boolean jolokiaEnabled; private boolean metricsEnabled; - private boolean uploadEnabled; - private String uploadSourceDir; - private boolean downloadEnabled; private boolean sendEnabled; @Metadata(label = "security") @@ -69,12 +58,12 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { @Metadata(label = "security", secret = true) private String jwtKeystorePassword; - @Metadata(defaultValue = "/q/health") - private String healthPath = "/q/health"; - @Metadata(defaultValue = "/q/jolokia") - private String jolokiaPath = "/q/jolokia"; + @Metadata(defaultValue = "/observe/health") + private String healthPath = "/observe/health"; + @Metadata(defaultValue = "/observe/jolokia") + private String jolokiaPath = "/observe/jolokia"; - public HttpServerConfigurationProperties(MainConfigurationProperties parent) { + public HttpManagementServerConfigurationProperties(MainConfigurationProperties parent) { this.parent = parent; } @@ -153,32 +142,6 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { this.useGlobalSslContextParameters = useGlobalSslContextParameters; } - public boolean isFileUploadEnabled() { - return fileUploadEnabled; - } - - /** - * Whether to enable file uploads being supported (such as POST multipart/form-data) and stored into a temporary - * directory. - */ - public void setFileUploadEnabled(boolean fileUploadEnabled) { - this.fileUploadEnabled = fileUploadEnabled; - } - - public String getFileUploadDirectory() { - return fileUploadDirectory; - } - - /** - * Directory to temporary store file uploads while Camel routes the incoming request. - * - * If no directory has been explicit configured, then a temporary directory is created in the java.io.tmpdir - * directory. - */ - public void setFileUploadDirectory(String fileUploadDirectory) { - this.fileUploadDirectory = fileUploadDirectory; - } - public boolean isInfoEnabled() { return infoEnabled; } @@ -190,41 +153,6 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { this.infoEnabled = infoEnabled; } - public boolean isStaticEnabled() { - return staticEnabled; - } - - /** - * Whether serving static files is enabled. If enabled then Camel can host html/js and other web files that makes it - * possible to include small web applications. - */ - public void setStaticEnabled(boolean staticEnabled) { - this.staticEnabled = staticEnabled; - } - - public String getStaticSourceDir() { - return staticSourceDir; - } - - /** - * Additional directory that holds static content when static is enabled. - */ - public void setStaticSourceDir(String staticSourceDir) { - this.staticSourceDir = staticSourceDir; - } - - public String getStaticContextPath() { - return staticContextPath; - } - - /** - * The context-path to use for serving static content. By default, the root path is used. And if there is an - * index.html page then this is automatically loaded. - */ - public void setStaticContextPath(String staticContextPath) { - this.staticContextPath = staticContextPath; - } - public boolean isDevConsoleEnabled() { return devConsoleEnabled; } @@ -295,44 +223,6 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { this.jolokiaPath = jolokiaPath; } - public boolean isUploadEnabled() { - return uploadEnabled; - } - - /** - * Whether to enable file upload via HTTP (not intended for production use). This functionality is for development - * to be able to reload Camel routes and code with source changes (if reload is enabled). If enabled then you can - * upload/delete files via HTTP PUT/DELETE on context-path: /q/upload/{name}. You must also configure the - * uploadSourceDir option. - */ - public void setUploadEnabled(boolean uploadEnabled) { - this.uploadEnabled = uploadEnabled; - } - - public String getUploadSourceDir() { - return uploadSourceDir; - } - - /** - * Source directory when upload is enabled. - */ - public void setUploadSourceDir(String uploadSourceDir) { - this.uploadSourceDir = uploadSourceDir; - } - - public boolean isDownloadEnabled() { - return downloadEnabled; - } - - /** - * Whether to enable file download via HTTP. This makes it possible to browse and download resource source files - * such as Camel XML or YAML routes. Only enable this for development, troubleshooting or special situations for - * management and monitoring. - */ - public void setDownloadEnabled(boolean downloadEnabled) { - this.downloadEnabled = downloadEnabled; - } - public boolean isSendEnabled() { return sendEnabled; } @@ -413,177 +303,103 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { } /** - * Whether embedded HTTP server is enabled. By default, the server is not enabled. + * Whether embedded HTTP management server is enabled. By default, the server is not enabled. */ - public HttpServerConfigurationProperties withEnabled(boolean enabled) { + public HttpManagementServerConfigurationProperties withEnabled(boolean enabled) { this.enabled = enabled; return this; } /** - * Hostname to use for binding embedded HTTP server + * Hostname to use for binding embedded HTTP management server */ - public HttpServerConfigurationProperties withHost(String host) { + public HttpManagementServerConfigurationProperties withHost(String host) { this.host = host; return this; } /** - * Port to use for binding embedded HTTP server + * Port to use for binding embedded HTTP management server */ - public HttpServerConfigurationProperties withPort(int port) { + public HttpManagementServerConfigurationProperties withPort(int port) { this.port = port; return this; } /** - * Context-path to use for embedded HTTP server + * Context-path to use for embedded HTTP management server */ - public HttpServerConfigurationProperties withPath(String path) { + public HttpManagementServerConfigurationProperties withPath(String path) { this.path = path; return this; } /** - * Maximum HTTP body size the embedded HTTP server can accept. + * Maximum HTTP body size the embedded HTTP management server can accept. */ - public HttpServerConfigurationProperties withMaxBodySize(long maxBodySize) { + public HttpManagementServerConfigurationProperties withMaxBodySize(long maxBodySize) { this.maxBodySize = maxBodySize; return this; } /** - * Whether to use global SSL configuration for securing the embedded HTTP server. + * Whether to use global SSL configuration for securing the embedded HTTP management server. */ - public HttpServerConfigurationProperties withUseGlobalSslContextParameters(boolean useGlobalSslContextParameters) { + public HttpManagementServerConfigurationProperties withUseGlobalSslContextParameters( + boolean useGlobalSslContextParameters) { this.useGlobalSslContextParameters = useGlobalSslContextParameters; return this; } /** - * Whether to enable file uploads being supported (such as POST multipart/form-data) and stored into a temporary - * directory. - */ - public HttpServerConfigurationProperties withFileUploadEnabled(boolean fileUploadEnabled) { - this.fileUploadEnabled = fileUploadEnabled; - return this; - } - - /** - * Directory to temporary store file uploads while Camel routes the incoming request. - * - * If no directory has been explicit configured, then a temporary directory is created in the java.io.tmpdir - * directory. - */ - public HttpServerConfigurationProperties withFileUploadDirectory(String fileUploadDirectory) { - this.fileUploadDirectory = fileUploadDirectory; - return this; - } - - /** - * Whether to enable info console. If enabled then you can see some basic Camel information at /q/info + * Whether to enable info console. If enabled then you can see some basic Camel information at /observe/info */ - public HttpServerConfigurationProperties withInfoEnabled(boolean infoEnabled) { + public HttpManagementServerConfigurationProperties withInfoEnabled(boolean infoEnabled) { this.infoEnabled = infoEnabled; return this; } - /** - * Whether serving static files is enabled. If enabled then Camel can host html/js and other web files that makes it - * possible to include small web applications. - */ - public HttpServerConfigurationProperties withStaticEnabled(boolean staticEnabled) { - this.staticEnabled = staticEnabled; - return this; - } - - /** - * Additional directory that holds static content when static is enabled. - */ - public HttpServerConfigurationProperties withStaticSourceDir(String staticSourceDir) { - this.staticSourceDir = staticSourceDir; - return this; - } - - /** - * The context-path to use for serving static content. By default, the root path is used. And if there is an - * index.html page then this is automatically loaded. - */ - public HttpServerConfigurationProperties withStaticContextPath(String staticContextPath) { - this.staticContextPath = staticContextPath; - return this; - } - /** * Whether to enable developer console (not intended for production use). Dev console must also be enabled on * CamelContext. For example by setting camel.context.dev-console=true in application.properties, or via code * <tt>camelContext.setDevConsole(true);</tt> If enabled then you can access a basic developer console on - * context-path: /q/dev. + * context-path: /observe/dev. */ - public HttpServerConfigurationProperties withDevConsoleEnabled(boolean devConsoleEnabled) { + public HttpManagementServerConfigurationProperties withDevConsoleEnabled(boolean devConsoleEnabled) { this.devConsoleEnabled = devConsoleEnabled; return this; } /** * Whether to enable health-check console. If enabled then you can access health-check status on context-path: - * /q/health (default) + * /observe/health (default) */ - public HttpServerConfigurationProperties withHealthCheckEnabled(boolean healthCheckEnabled) { + public HttpManagementServerConfigurationProperties withHealthCheckEnabled(boolean healthCheckEnabled) { this.healthCheckEnabled = healthCheckEnabled; return this; } /** - * Whether to enable jolokia. If enabled then you can access jolokia api on context-path: /q/jolokia + * Whether to enable jolokia. If enabled then you can access jolokia api on context-path: /observe/jolokia */ - public HttpServerConfigurationProperties withJolokiaEnabled(boolean jolokiaEnabled) { + public HttpManagementServerConfigurationProperties withJolokiaEnabled(boolean jolokiaEnabled) { this.jolokiaEnabled = jolokiaEnabled; return this; } /** - * Whether to enable metrics. If enabled then you can access metrics on context-path: /q/metrics (default) + * Whether to enable metrics. If enabled then you can access metrics on context-path: /observe/metrics (default) */ - public HttpServerConfigurationProperties withMetricsEnabled(boolean metricsEnabled) { + public HttpManagementServerConfigurationProperties withMetricsEnabled(boolean metricsEnabled) { this.metricsEnabled = metricsEnabled; return this; } - /** - * Whether to enable file upload via HTTP (not intended for production use). This functionality is for development - * to be able to reload Camel routes and code with source changes (if reload is enabled). If enabled then you can - * upload/delete files via HTTP PUT/DELETE on context-path: /q/upload/{name}. You must also configure the - * uploadSourceDir option. - */ - public HttpServerConfigurationProperties withUploadEnabled(boolean uploadEnabled) { - this.uploadEnabled = uploadEnabled; - return this; - } - - /** - * Source directory when upload is enabled. - */ - public HttpServerConfigurationProperties withUploadSourceDir(String uploadSourceDir) { - this.uploadSourceDir = uploadSourceDir; - return this; - } - - /** - * Whether to enable file download via HTTP. This makes it possible to browse and download resource source files - * such as Camel XML or YAML routes. Only enable this for development, troubleshooting or special situations for - * management and monitoring. - */ - public HttpServerConfigurationProperties withDownloadEnabled(boolean downloadEnabled) { - this.downloadEnabled = downloadEnabled; - return this; - } - /** * Whether to enable sending messages to Camel via HTTP. This makes it possible to use Camel to send messages to * Camel endpoint URIs via HTTP. */ - public HttpServerConfigurationProperties withSendEnabled(boolean sendEnabled) { + public HttpManagementServerConfigurationProperties withSendEnabled(boolean sendEnabled) { this.sendEnabled = sendEnabled; return this; } @@ -592,15 +408,15 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { * Whether to enable HTTP authentication for embedded server (for standalone applications; not Spring Boot or * Quarkus). */ - public HttpServerConfigurationProperties withAuthenticationEnabled(boolean authenticationEnabled) { + public HttpManagementServerConfigurationProperties withAuthenticationEnabled(boolean authenticationEnabled) { this.authenticationEnabled = authenticationEnabled; return this; } /** - * Set HTTP url path of embedded server that is protected by authentication configuration. + * Set HTTP url path of embedded management server that is protected by authentication configuration. */ - public HttpServerConfigurationProperties withAuthenticationPath(String authenticationPath) { + public HttpManagementServerConfigurationProperties withAuthenticationPath(String authenticationPath) { this.authenticationPath = authenticationPath; return this; } @@ -608,7 +424,7 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { /** * Name of the file that contains basic authentication info for Vert.x file auth provider. */ - public HttpServerConfigurationProperties withBasicPropertiesFile(String basicPropertiesFile) { + public HttpManagementServerConfigurationProperties withBasicPropertiesFile(String basicPropertiesFile) { this.basicPropertiesFile = basicPropertiesFile; return this; } @@ -616,7 +432,7 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { /** * Type of the keystore used for JWT tokens validation (jks, pkcs12, etc.). */ - public HttpServerConfigurationProperties withJwtKeystoreType(String jwtKeystoreType) { + public HttpManagementServerConfigurationProperties withJwtKeystoreType(String jwtKeystoreType) { this.jwtKeystoreType = jwtKeystoreType; return this; } @@ -624,7 +440,7 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { /** * Path to the keystore file used for JWT tokens validation. */ - public HttpServerConfigurationProperties withJwtKeystorePath(String jwtKeystorePath) { + public HttpManagementServerConfigurationProperties withJwtKeystorePath(String jwtKeystorePath) { this.jwtKeystorePath = jwtKeystorePath; return this; } @@ -632,7 +448,7 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { /** * Password from the keystore used for JWT tokens validation. */ - public HttpServerConfigurationProperties withJwtKeystorePassword(String jwtKeystorePassword) { + public HttpManagementServerConfigurationProperties withJwtKeystorePassword(String jwtKeystorePassword) { this.jwtKeystorePassword = jwtKeystorePassword; return this; } @@ -640,7 +456,7 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { /** * The path endpoint used to expose the health status */ - public HttpServerConfigurationProperties withHealthPath(String healthPath) { + public HttpManagementServerConfigurationProperties withHealthPath(String healthPath) { this.healthPath = healthPath; return this; } @@ -648,7 +464,7 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { /** * The path endpoint used to expose the jolokia data. */ - public HttpServerConfigurationProperties withJolokiaPath(String jolokiaPath) { + public HttpManagementServerConfigurationProperties withJolokiaPath(String jolokiaPath) { this.jolokiaPath = jolokiaPath; return this; } diff --git a/core/camel-main/src/main/java/org/apache/camel/main/HttpServerConfigurationProperties.java b/core/camel-main/src/main/java/org/apache/camel/main/HttpServerConfigurationProperties.java index ffb959d97df..3b16350796b 100644 --- a/core/camel-main/src/main/java/org/apache/camel/main/HttpServerConfigurationProperties.java +++ b/core/camel-main/src/main/java/org/apache/camel/main/HttpServerConfigurationProperties.java @@ -42,14 +42,19 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { private boolean fileUploadEnabled = true; @Metadata private String fileUploadDirectory; + @Deprecated private boolean infoEnabled; private boolean staticEnabled; private String staticSourceDir; @Metadata(defaultValue = "/") private String staticContextPath = "/"; + @Deprecated private boolean devConsoleEnabled; + @Deprecated private boolean healthCheckEnabled; + @Deprecated private boolean jolokiaEnabled; + @Deprecated private boolean metricsEnabled; private boolean uploadEnabled; private String uploadSourceDir; @@ -69,8 +74,10 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { @Metadata(label = "security", secret = true) private String jwtKeystorePassword; + @Deprecated @Metadata(defaultValue = "/q/health") private String healthPath = "/q/health"; + @Deprecated @Metadata(defaultValue = "/q/jolokia") private String jolokiaPath = "/q/jolokia"; @@ -179,12 +186,14 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { this.fileUploadDirectory = fileUploadDirectory; } + @Deprecated(since = "4.12.0") public boolean isInfoEnabled() { return infoEnabled; } /** - * Whether to enable info console. If enabled then you can see some basic Camel information at /q/info + * Whether to enable info console. If enabled then you can see some basic Camel information at /q/info. Deprecated + * since 4.12.0, use HTTP management server instead. */ public void setInfoEnabled(boolean infoEnabled) { this.infoEnabled = infoEnabled; @@ -233,63 +242,70 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { * Whether to enable developer console (not intended for production use). Dev console must also be enabled on * CamelContext. For example by setting camel.context.dev-console=true in application.properties, or via code * <tt>camelContext.setDevConsole(true);</tt> If enabled then you can access a basic developer console on - * context-path: /q/dev. + * context-path: /q/dev. Deprecated since 4.12.0, use HTTP management server instead. */ public void setDevConsoleEnabled(boolean devConsoleEnabled) { this.devConsoleEnabled = devConsoleEnabled; } + @Deprecated(since = "4.12.0") public boolean isHealthCheckEnabled() { return healthCheckEnabled; } /** * Whether to enable health-check console. If enabled then you can access health-check status on context-path: - * /q/health (default) + * /q/health (default). Deprecated since 4.12.0, use HTTP management server instead. */ public void setHealthCheckEnabled(boolean healthCheckEnabled) { this.healthCheckEnabled = healthCheckEnabled; } + @Deprecated(since = "4.12.0") public boolean isJolokiaEnabled() { return jolokiaEnabled; } /** - * Whether to enable jolokia. If enabled then you can access jolokia api on context-path: /q/jolokia + * Whether to enable jolokia. If enabled then you can access jolokia api on context-path: /q/jolokia. Deprecated + * since 4.12.0, use HTTP management server instead. */ public void setJolokiaEnabled(boolean jolokiaEnabled) { this.jolokiaEnabled = jolokiaEnabled; } + @Deprecated(since = "4.12.0") public boolean isMetricsEnabled() { return metricsEnabled; } /** - * Whether to enable metrics. If enabled then you can access metrics on context-path: /q/metrics (default) + * Whether to enable metrics. If enabled then you can access metrics on context-path: /q/metrics (default). + * Deprecated since 4.12.0, use HTTP management server instead. */ public void setMetricsEnabled(boolean metricsEnabled) { this.metricsEnabled = metricsEnabled; } + @Deprecated(since = "4.12.0") public String getHealthPath() { return healthPath; } /** - * The path endpoint used to expose the health status + * The path endpoint used to expose the health status. Deprecated since 4.12.0, use HTTP management server instead. */ public void setHealthPath(String healthPath) { this.healthPath = healthPath; } + @Deprecated(since = "4.12.0") public String getJolokiaPath() { return jolokiaPath; } /** - * The path endpoint used to expose the jolokia data. + * The path endpoint used to expose the jolokia data. Deprecated since 4.12.0, use HTTP management server instead. */ public void setJolokiaPath(String jolokiaPath) { this.jolokiaPath = jolokiaPath; @@ -515,10 +531,11 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { } /** + * * Whether to enable developer console (not intended for production use). Dev console must also be enabled on * CamelContext. For example by setting camel.context.dev-console=true in application.properties, or via code * <tt>camelContext.setDevConsole(true);</tt> If enabled then you can access a basic developer console on - * context-path: /q/dev. + * context-path: /q/dev. Deprecated since 4.12.0, use HTTP management server instead. */ public HttpServerConfigurationProperties withDevConsoleEnabled(boolean devConsoleEnabled) { this.devConsoleEnabled = devConsoleEnabled; @@ -527,7 +544,7 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { /** * Whether to enable health-check console. If enabled then you can access health-check status on context-path: - * /q/health (default) + * /q/health (default). Deprecated since 4.12.0, use HTTP management server instead. */ public HttpServerConfigurationProperties withHealthCheckEnabled(boolean healthCheckEnabled) { this.healthCheckEnabled = healthCheckEnabled; @@ -535,7 +552,8 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { } /** - * Whether to enable jolokia. If enabled then you can access jolokia api on context-path: /q/jolokia + * Whether to enable jolokia. If enabled then you can access jolokia api on context-path: /q/jolokia. Deprecated + * since 4.12.0, use HTTP management server instead. */ public HttpServerConfigurationProperties withJolokiaEnabled(boolean jolokiaEnabled) { this.jolokiaEnabled = jolokiaEnabled; @@ -543,7 +561,8 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { } /** - * Whether to enable metrics. If enabled then you can access metrics on context-path: /q/metrics (default) + * Whether to enable metrics. If enabled then you can access metrics on context-path: /q/metrics (default). + * Deprecated since 4.12.0, use HTTP management server instead. */ public HttpServerConfigurationProperties withMetricsEnabled(boolean metricsEnabled) { this.metricsEnabled = metricsEnabled; @@ -646,7 +665,7 @@ public class HttpServerConfigurationProperties implements BootstrapCloseable { } /** - * The path endpoint used to expose the jolokia data. + * The path endpoint used to expose the jolokia data. Deprecated since 4.12.0, use HTTP management server instead. */ public HttpServerConfigurationProperties withJolokiaPath(String jolokiaPath) { this.jolokiaPath = jolokiaPath; diff --git a/core/camel-main/src/main/java/org/apache/camel/main/MainConfigurationProperties.java b/core/camel-main/src/main/java/org/apache/camel/main/MainConfigurationProperties.java index 29de01e0fc2..1048cd15014 100644 --- a/core/camel-main/src/main/java/org/apache/camel/main/MainConfigurationProperties.java +++ b/core/camel-main/src/main/java/org/apache/camel/main/MainConfigurationProperties.java @@ -69,6 +69,7 @@ public class MainConfigurationProperties extends DefaultConfigurationProperties< private RestConfigurationProperties restConfigurationProperties; private VaultConfigurationProperties vaultConfigurationProperties; private HttpServerConfigurationProperties httpServerConfigurationProperties; + private HttpManagementServerConfigurationProperties httpManagementServerConfigurationProperties; private SSLConfigurationProperties sslConfigurationProperties; private DebuggerConfigurationProperties debuggerConfigurationProperties; private TracerConfigurationProperties tracerConfigurationProperties; @@ -124,6 +125,10 @@ public class MainConfigurationProperties extends DefaultConfigurationProperties< httpServerConfigurationProperties.close(); httpServerConfigurationProperties = null; } + if (httpManagementServerConfigurationProperties != null) { + httpManagementServerConfigurationProperties.close(); + httpManagementServerConfigurationProperties = null; + } if (sslConfigurationProperties != null) { sslConfigurationProperties.close(); sslConfigurationProperties = null; @@ -259,6 +264,16 @@ public class MainConfigurationProperties extends DefaultConfigurationProperties< return httpServerConfigurationProperties; } + /** + * To configure embedded HTTP management server (for standalone applications; not Spring Boot or Quarkus) + */ + public HttpManagementServerConfigurationProperties httpManagementServer() { + if (httpManagementServerConfigurationProperties == null) { + httpManagementServerConfigurationProperties = new HttpManagementServerConfigurationProperties(this); + } + return httpManagementServerConfigurationProperties; + } + /** * Whether there has been any embedded HTTP server configuration specified */ @@ -266,6 +281,13 @@ public class MainConfigurationProperties extends DefaultConfigurationProperties< return httpServerConfigurationProperties != null; } + /** + * Whether there has been any embedded HTTP management server configuration specified + */ + public boolean hasHttpManagementServerConfiguration() { + return httpManagementServerConfigurationProperties != null; + } + /** * To configure SSL. */ diff --git a/core/camel-main/src/main/java/org/apache/camel/main/MainHttpServerFactory.java b/core/camel-main/src/main/java/org/apache/camel/main/MainHttpServerFactory.java index f149cc90549..24875d89b13 100644 --- a/core/camel-main/src/main/java/org/apache/camel/main/MainHttpServerFactory.java +++ b/core/camel-main/src/main/java/org/apache/camel/main/MainHttpServerFactory.java @@ -32,4 +32,14 @@ public interface MainHttpServerFactory { * @return the server as a {@link Service} to be managed by {@link org.apache.camel.CamelContext}. */ Service newHttpServer(CamelContext camelContext, HttpServerConfigurationProperties configuration); + + /** + * Creates the embedded HTTP management server + * + * @param camelContext the camel context + * @param configuration server configuration + * @return the server as a {@link Service} to be managed by {@link org.apache.camel.CamelContext}. + */ + Service newHttpManagementServer(CamelContext camelContext, HttpManagementServerConfigurationProperties configuration); + } diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCamelMainMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCamelMainMojo.java index 39c7e697b0a..3b6f51469f0 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCamelMainMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/PrepareCamelMainMojo.java @@ -231,6 +231,8 @@ public class PrepareCamelMainMojo extends AbstractGeneratorMojo { prefix = "camel.metrics."; } else if (file.getName().contains("HttpServer")) { prefix = "camel.server."; + } else if (file.getName().contains("HttpManagementServer")) { + prefix = "camel.management.server."; } else if (file.getName().contains("ThreadPoolProfileConfigurationProperties")) { // skip this file continue; @@ -372,6 +374,10 @@ public class PrepareCamelMainMojo extends AbstractGeneratorMojo { "camel.server", "Camel Embedded HTTP Server (only for standalone; not Spring Boot or Quarkus) configurations", "org.apache.camel.main.HttpServerConfigurationProperties")); + model.getGroups().add(new MainGroupModel( + "camel.management.server", + "Camel Embedded HTTP management Server (only for standalone; not Spring Boot or Quarkus) configurations", + "org.apache.camel.main.HttpManagementServerConfigurationProperties")); model.getGroups() .add(new MainGroupModel( "camel.debug", "Camel Debugger configurations",