You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2025/04/29 12:01:43 UTC

(camel-quarkus) branch camel-main updated (c48863f90b -> 8db57e9466)

This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a change to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


    from c48863f90b regen files
     new 9f22c1ef59 chore(platform-http): use default router name
     new 8db57e9466 feat(observability-services): use management port

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../pages/reference/extensions/observability-services.adoc  |  2 ++
 .../observability-services/runtime/src/main/doc/usage.adoc  |  2 ++
 .../runtime/src/main/resources/application.properties       |  2 ++
 .../platform/http/deployment/PlatformHttpProcessor.java     | 13 ++++++++++---
 .../platform/http/runtime/PlatformHttpRecorder.java         |  4 ++--
 .../observabilityservices/it/ObservabilityServicesTest.java | 12 ++++++++----
 6 files changed, 26 insertions(+), 9 deletions(-)


(camel-quarkus) 02/02: feat(observability-services): use management port

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 8db57e9466b7b66203c8e22a8476eb7de5f72dfc
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Fri Apr 25 11:49:28 2025 +0200

    feat(observability-services): use management port
---
 .../pages/reference/extensions/observability-services.adoc   |  2 ++
 .../observability-services/runtime/src/main/doc/usage.adoc   |  2 ++
 .../runtime/src/main/resources/application.properties        |  2 ++
 .../observabilityservices/it/ObservabilityServicesTest.java  | 12 ++++++++----
 4 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/docs/modules/ROOT/pages/reference/extensions/observability-services.adoc b/docs/modules/ROOT/pages/reference/extensions/observability-services.adoc
index 84d4c63736..687c1006f1 100644
--- a/docs/modules/ROOT/pages/reference/extensions/observability-services.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/observability-services.adoc
@@ -83,6 +83,8 @@ The presence of this extension will expose the following endpoints:
 
 |====
 
+By default, these endpoints are exposed on the management port (`9876`). This value can be changed as any other configuration (in this case, via `quarkus.management.port` application property). You can also disable it (`quarkus.management.enabled=false`) if you want to expose those endpoints in the regular service port (default, `8080`).
+
 NOTE: You can configure the endpoints as you'd do normally within each extension configuration.
 
 [id="extensions-observability-services-usage-opentelemetry-configuration"]
diff --git a/extensions/observability-services/runtime/src/main/doc/usage.adoc b/extensions/observability-services/runtime/src/main/doc/usage.adoc
index 72170253c1..6d1f9f960c 100644
--- a/extensions/observability-services/runtime/src/main/doc/usage.adoc
+++ b/extensions/observability-services/runtime/src/main/doc/usage.adoc
@@ -33,6 +33,8 @@ The presence of this extension will expose the following endpoints:
 
 |====
 
+By default, these endpoints are exposed on the management port (`9876`). This value can be changed as any other configuration (in this case, via `quarkus.management.port` application property). You can also disable it (`quarkus.management.enabled=false`) if you want to expose those endpoints in the regular service port (default, `8080`).
+
 NOTE: You can configure the endpoints as you'd do normally within each extension configuration.
 
 == OpenTelemetry configuration
diff --git a/extensions/observability-services/runtime/src/main/resources/application.properties b/extensions/observability-services/runtime/src/main/resources/application.properties
index 37437c7b2c..4daf4eb27d 100644
--- a/extensions/observability-services/runtime/src/main/resources/application.properties
+++ b/extensions/observability-services/runtime/src/main/resources/application.properties
@@ -14,6 +14,8 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 ## ---------------------------------------------------------------------------
+quarkus.management.enabled=true
+quarkus.management.port=9876
 quarkus.micrometer.export.prometheus.path=/observe/metrics
 quarkus.smallrye-health.root-path=/observe/health
 # Default is disabled: the user must enable it to push traces to the given server
diff --git a/integration-tests/observability-services/src/test/java/org/apache/camel/quarkus/component/observabilityservices/it/ObservabilityServicesTest.java b/integration-tests/observability-services/src/test/java/org/apache/camel/quarkus/component/observabilityservices/it/ObservabilityServicesTest.java
index 895ab8f5f1..47c00ab2dd 100644
--- a/integration-tests/observability-services/src/test/java/org/apache/camel/quarkus/component/observabilityservices/it/ObservabilityServicesTest.java
+++ b/integration-tests/observability-services/src/test/java/org/apache/camel/quarkus/component/observabilityservices/it/ObservabilityServicesTest.java
@@ -40,7 +40,8 @@ class ObservabilityServicesTest {
 
     @Test
     void testHealthUpStatus() {
-        RestAssured.when().get("/observe/health").then()
+        // Use testing management port
+        RestAssured.when().get("http://localhost:9001/observe/health").then()
                 .contentType(ContentType.JSON)
                 .header("Content-Type", containsString("charset=UTF-8"))
                 .body("status", is("UP"),
@@ -53,7 +54,8 @@ class ObservabilityServicesTest {
 
     @Test
     void testLivenessUpStatus() {
-        RestAssured.when().get("/observe/health/live").then()
+        // Use testing management port
+        RestAssured.when().get("http://localhost:9001/observe/health/live").then()
                 .contentType(ContentType.JSON)
                 .header("Content-Type", containsString("charset=UTF-8"))
                 .body("status", is("UP"),
@@ -62,7 +64,8 @@ class ObservabilityServicesTest {
 
     @Test
     void testReadinessUpStatus() {
-        RestAssured.when().get("/observe/health/ready").then()
+        // Use testing management port
+        RestAssured.when().get("http://localhost:9001/observe/health/ready").then()
                 .contentType(ContentType.JSON)
                 .header("Content-Type", containsString("charset=UTF-8"))
                 .body("status", is("UP"),
@@ -71,7 +74,8 @@ class ObservabilityServicesTest {
 
     @Test
     void testMetricsStatus() {
-        RestAssured.when().get("/observe/metrics").then()
+        // Use testing management port
+        RestAssured.when().get("http://localhost:9001/observe/metrics").then()
                 .header("Content-Type", containsString("application/openmetrics-text"))
                 .statusCode(HttpStatus.SC_OK);
     }


(camel-quarkus) 01/02: chore(platform-http): use default router name

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 9f22c1ef59cdfffe978b7b2b22bbbbb54b8164ff
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Fri Apr 25 11:49:07 2025 +0200

    chore(platform-http): use default router name
---
 .../platform/http/deployment/PlatformHttpProcessor.java     | 13 ++++++++++---
 .../platform/http/runtime/PlatformHttpRecorder.java         |  4 ++--
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/extensions/platform-http/deployment/src/main/java/org/apache/camel/quarkus/component/platform/http/deployment/PlatformHttpProcessor.java b/extensions/platform-http/deployment/src/main/java/org/apache/camel/quarkus/component/platform/http/deployment/PlatformHttpProcessor.java
index 824deff048..9f841ce4a2 100644
--- a/extensions/platform-http/deployment/src/main/java/org/apache/camel/quarkus/component/platform/http/deployment/PlatformHttpProcessor.java
+++ b/extensions/platform-http/deployment/src/main/java/org/apache/camel/quarkus/component/platform/http/deployment/PlatformHttpProcessor.java
@@ -28,10 +28,13 @@ import org.apache.camel.component.platform.http.PlatformHttpComponent;
 import org.apache.camel.component.platform.http.PlatformHttpConstants;
 import org.apache.camel.component.platform.http.vertx.VertxPlatformHttpEngine;
 import org.apache.camel.component.platform.http.vertx.VertxPlatformHttpRouter;
+import org.apache.camel.component.platform.http.vertx.VertxPlatformHttpServerConfiguration;
 import org.apache.camel.quarkus.component.platform.http.runtime.PlatformHttpRecorder;
 import org.apache.camel.quarkus.core.deployment.spi.CamelRuntimeBeanBuildItem;
 import org.apache.camel.quarkus.core.deployment.spi.CamelServiceFilter;
 import org.apache.camel.quarkus.core.deployment.spi.CamelServiceFilterBuildItem;
+import org.eclipse.microprofile.config.Config;
+import org.eclipse.microprofile.config.ConfigProvider;
 
 class PlatformHttpProcessor {
     private static final String FEATURE = "camel-platform-http";
@@ -71,11 +74,15 @@ class PlatformHttpProcessor {
             VertxWebRouterBuildItem router,
             BodyHandlerBuildItem bodyHandler,
             PlatformHttpRecorder recorder) {
+        // at build time we're safe using the default, as it's the value used to register the router
+        // regardless if the port changes at runtime
+        String routerName = VertxPlatformHttpRouter.getRouterNameFromPort(
+                VertxPlatformHttpServerConfiguration.DEFAULT_BIND_PORT);
         return new CamelRuntimeBeanBuildItem(
-                VertxPlatformHttpRouter.PLATFORM_HTTP_ROUTER_NAME,
+                routerName,
                 Router.class.getName(),
-                recorder.createVertxPlatformHttpRouter(vertx.getVertx(), router.getHttpRouter(), bodyHandler.getHandler(),
-                        VertxPlatformHttpRouter.PLATFORM_HTTP_ROUTER_NAME));
+                recorder.createVertxPlatformHttpRouter(
+                        vertx.getVertx(), router.getHttpRouter(), bodyHandler.getHandler(), routerName));
     }
 
     @Record(ExecutionTime.RUNTIME_INIT)
diff --git a/extensions/platform-http/runtime/src/main/java/org/apache/camel/quarkus/component/platform/http/runtime/PlatformHttpRecorder.java b/extensions/platform-http/runtime/src/main/java/org/apache/camel/quarkus/component/platform/http/runtime/PlatformHttpRecorder.java
index c994ae5718..601724f83c 100644
--- a/extensions/platform-http/runtime/src/main/java/org/apache/camel/quarkus/component/platform/http/runtime/PlatformHttpRecorder.java
+++ b/extensions/platform-http/runtime/src/main/java/org/apache/camel/quarkus/component/platform/http/runtime/PlatformHttpRecorder.java
@@ -40,9 +40,9 @@ public class PlatformHttpRecorder {
     }
 
     public RuntimeValue<VertxPlatformHttpRouter> createVertxPlatformHttpRouter(RuntimeValue<Vertx> vertx,
-            RuntimeValue<Router> router, Handler<RoutingContext> handler, String name) {
+            RuntimeValue<Router> router, Handler<RoutingContext> handler, String routerName) {
         VertxPlatformHttpRouter vertxPlatformHttpRouter = new VertxPlatformHttpRouter(null, vertx.getValue(),
-                router.getValue(), name) {
+                router.getValue(), routerName) {
             @Override
             public Handler<RoutingContext> bodyHandler() {
                 return handler;