You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pp...@apache.org on 2025/10/03 10:58:22 UTC
(camel-quarkus-examples) 11/12: Use observability-services extension in Health example project
This is an automated email from the ASF dual-hosted git repository.
ppalaga pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus-examples.git
commit aff19de86ccb5a46ae330d4cea933cf95bcca121
Author: James Netherton <ja...@gmail.com>
AuthorDate: Mon Sep 22 08:20:11 2025 +0100
Use observability-services extension in Health example project
---
health/pom.xml | 2 +-
health/src/main/resources/application.properties | 4 ----
health/src/test/java/org/acme/health/HealthIT.java | 5 +++++
health/src/test/java/org/acme/health/HealthTest.java | 10 ++++++++--
4 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/health/pom.xml b/health/pom.xml
index d00f110..76c2dd5 100644
--- a/health/pom.xml
+++ b/health/pom.xml
@@ -83,7 +83,7 @@
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-microprofile-health</artifactId>
+ <artifactId>camel-quarkus-observability-services</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
diff --git a/health/src/main/resources/application.properties b/health/src/main/resources/application.properties
index b317b68..a97f65b 100644
--- a/health/src/main/resources/application.properties
+++ b/health/src/main/resources/application.properties
@@ -23,10 +23,6 @@ quarkus.banner.enabled = false
# here you can configure options on camel quarkus
camel.quakus.name = MyHealthyCamel
-# extended runtime statistics about bean introspection usage (java reflection)
-camel.main.bean-introspection-extended-statistics=true
-camel.main.bean-introspection-logging-level=INFO
-
# enable supervised route controller which will startup routes in safe manner
camel.routeController.enabled = true
# attempt up till 10 times to start a route (and exhaust if still failing)
diff --git a/health/src/test/java/org/acme/health/HealthIT.java b/health/src/test/java/org/acme/health/HealthIT.java
index 99e696c..f010501 100644
--- a/health/src/test/java/org/acme/health/HealthIT.java
+++ b/health/src/test/java/org/acme/health/HealthIT.java
@@ -17,7 +17,12 @@
package org.acme.health;
import io.quarkus.test.junit.QuarkusIntegrationTest;
+import org.eclipse.microprofile.config.ConfigProvider;
@QuarkusIntegrationTest
class HealthIT extends HealthTest {
+ @Override
+ protected Integer getManagementPort() {
+ return ConfigProvider.getConfig().getValue("quarkus.management.port", Integer.class);
+ }
}
diff --git a/health/src/test/java/org/acme/health/HealthTest.java b/health/src/test/java/org/acme/health/HealthTest.java
index fc4bf27..2f76d03 100644
--- a/health/src/test/java/org/acme/health/HealthTest.java
+++ b/health/src/test/java/org/acme/health/HealthTest.java
@@ -18,6 +18,7 @@ package org.acme.health;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
+import org.eclipse.microprofile.config.ConfigProvider;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
@@ -27,8 +28,9 @@ import static org.hamcrest.CoreMatchers.is;
public class HealthTest {
@Test
- public void testHealth() throws InterruptedException {
- RestAssured.get("/q/health")
+ public void testHealth() {
+ RestAssured.port = getManagementPort();
+ RestAssured.get("/observe/health")
.then()
.statusCode(503)
.body("status", is("DOWN"),
@@ -37,4 +39,8 @@ public class HealthTest {
"checks.findAll { it.name == 'camel-routes' }.status", Matchers.contains("DOWN"),
"checks.findAll { it.name == 'camel-consumers' }.status", Matchers.contains("DOWN"));
}
+
+ protected Integer getManagementPort() {
+ return ConfigProvider.getConfig().getValue("quarkus.management.test-port", Integer.class);
+ }
}