[ https://issues.apache.org/jira/browse/CAMEL-12459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16465480#comment-16465480 ]
ASF GitHub Bot commented on CAMEL-12459: ---------------------------------------- lburgazzoli closed pull request #2323: CAMEL-12459:camel-spring-boot - Add route group to route actuator URL: https://github.com/apache/camel/pull/2323 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java index f7978e40101..734a8c2d2ac 100644 --- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java +++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java @@ -38,9 +38,9 @@ import org.springframework.boot.actuate.endpoint.annotation.ReadOperation; import org.springframework.boot.actuate.endpoint.annotation.Selector; import org.springframework.boot.actuate.endpoint.annotation.WriteOperation; -import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.lang.Nullable; + /** * {@link Endpoint} to expose {@link org.apache.camel.Route} information. */ @@ -200,11 +200,13 @@ private void resumeRoute(String id) { /** * Container for exposing {@link org.apache.camel.Route} information as JSON. */ - @JsonPropertyOrder({"id", "description", "uptime", "uptimeMillis"}) + @JsonPropertyOrder({"id", "group", "description", "uptime", "uptimeMillis"}) @JsonInclude(JsonInclude.Include.NON_EMPTY) public static class RouteEndpointInfo { private final String id; + + private final String group; private final String description; @@ -216,6 +218,7 @@ private void resumeRoute(String id) { public RouteEndpointInfo(Route route) { this.id = route.getId(); + this.group = route.getGroup(); this.description = route.getDescription(); this.uptime = route.getUptime(); this.uptimeMillis = route.getUptimeMillis(); @@ -230,6 +233,10 @@ public RouteEndpointInfo(Route route) { public String getId() { return id; } + + public String getGroup() { + return group; + } public String getDescription() { return description; diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/ActuatorTestRoute.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/ActuatorTestRoute.java index 599f94037b9..7186177a2e4 100644 --- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/ActuatorTestRoute.java +++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/ActuatorTestRoute.java @@ -24,7 +24,7 @@ @Override public void configure() throws Exception { - from("timer:foo").routeId("foo-route").to("log:foo"); + from("timer:foo").routeId("foo-route").routeGroup("foo-route-group").to("log:foo"); } } diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointTest.java index c084e3d3bb7..095b68d7552 100644 --- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointTest.java +++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpointTest.java @@ -58,6 +58,7 @@ public void testRoutesEndpoint() throws Exception { assertFalse(routes.isEmpty()); assertEquals(routes.size(), camelContext.getRoutes().size()); assertTrue(routes.stream().anyMatch(r -> "foo-route".equals(r.getId()))); + assertTrue(routes.stream().anyMatch(r -> "foo-route-group".equals(r.getGroup()))); } @Test(expected = IllegalArgumentException.class) diff --git a/examples/camel-example-spring-boot/src/main/java/sample/camel/MyCamelRouter.java b/examples/camel-example-spring-boot/src/main/java/sample/camel/MyCamelRouter.java index 5770e149630..c8b0bfd26e4 100644 --- a/examples/camel-example-spring-boot/src/main/java/sample/camel/MyCamelRouter.java +++ b/examples/camel-example-spring-boot/src/main/java/sample/camel/MyCamelRouter.java @@ -29,7 +29,7 @@ @Override public void configure() throws Exception { - from("timer:hello?period={{timer.period}}").routeId("hello") + from("timer:hello?period={{timer.period}}").routeId("hello").routeGroup("hello-group") .transform().method("myBean", "saySomething") .filter(simple("${body} contains 'foo'")) .to("log:foo") ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > camel-spring-boot - Add route group to route actuator > ----------------------------------------------------- > > Key: CAMEL-12459 > URL: https://issues.apache.org/jira/browse/CAMEL-12459 > Project: Camel > Issue Type: Improvement > Components: camel-spring-boot > Reporter: Claus Ibsen > Priority: Major > Fix For: 2.22.0 > > > A route can have a group assigned, and if it has, then we should output the > group in the routes actuator for the info and route details we have. -- This message was sent by Atlassian JIRA (v7.6.3#76005)