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

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new cb97ab5  CAMEL-12459:camel-spring-boot - Add route group to route 
actuator
cb97ab5 is described below

commit cb97ab509ee8fc279fcded291b2454965c5484c0
Author: Ramu <kkaka...@redhat.com>
AuthorDate: Mon May 7 11:46:29 2018 +0530

    CAMEL-12459:camel-spring-boot - Add route group to route actuator
---
 .../spring/boot/actuate/endpoint/CamelRoutesEndpoint.java     | 11 +++++++++--
 .../camel/spring/boot/actuate/endpoint/ActuatorTestRoute.java |  2 +-
 .../spring/boot/actuate/endpoint/CamelRoutesEndpointTest.java |  1 +
 .../src/main/java/sample/camel/MyCamelRouter.java             |  2 +-
 4 files changed, 12 insertions(+), 4 deletions(-)

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 f7978e4..734a8c2 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.Endpoint;
 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 @@ public class CamelRoutesEndpoint {
     /**
      * 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 @@ public class CamelRoutesEndpoint {
 
         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 class CamelRoutesEndpoint {
         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 599f940..7186177 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 @@ public class ActuatorTestRoute extends RouteBuilder {
 
     @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 c084e3d..095b68d 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 class CamelRoutesEndpointTest extends Assert {
         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 5770e14..c8b0bfd 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 @@ public class MyCamelRouter extends RouteBuilder {
 
     @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")

-- 
To stop receiving notification emails like this one, please contact
lburgazz...@apache.org.

Reply via email to