CAMEL-11586: added default camel route path. This closes #1848.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7bbcb8a8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7bbcb8a8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7bbcb8a8

Branch: refs/heads/master
Commit: 7bbcb8a84f0fd5d507ade129b422283378543715
Parents: 1f6b08e
Author: Claus Ibsen <davscl...@apache.org>
Authored: Tue Jul 25 21:27:51 2017 +0200
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Tue Jul 25 21:27:51 2017 +0200

----------------------------------------------------------------------
 .../boot/actuate/endpoint/CamelRoutesEndpoint.java   |  2 ++
 .../actuate/endpoint/CamelRoutesMvcEndpoint.java     |  6 +++++-
 .../additional-spring-configuration-metadata.json    |  2 +-
 .../readme.adoc                                      |  2 +-
 .../src/main/resources/application.properties        |  7 +++++--
 examples/camel-example-spring-boot/readme.adoc       | 15 +++++++++++++++
 .../src/main/resources/application.properties        | 11 +++++++++++
 7 files changed, 40 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7bbcb8a8/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesEndpoint.java
----------------------------------------------------------------------
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 208f2df..1e24907 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
@@ -48,6 +48,8 @@ public class CamelRoutesEndpoint extends 
AbstractEndpoint<List<RouteEndpointInfo
     public CamelRoutesEndpoint(CamelContext camelContext) {
         super(ENDPOINT_ID);
         this.camelContext = camelContext;
+        // is enabled by default
+        this.setEnabled(true);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/camel/blob/7bbcb8a8/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesMvcEndpoint.java
----------------------------------------------------------------------
diff --git 
a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesMvcEndpoint.java
 
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesMvcEndpoint.java
index 9933c78..a0a09e2 100644
--- 
a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesMvcEndpoint.java
+++ 
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/endpoint/CamelRoutesMvcEndpoint.java
@@ -40,13 +40,17 @@ import 
org.springframework.web.bind.annotation.ResponseStatus;
 @ConfigurationProperties(prefix = "endpoints." + 
CamelRoutesEndpoint.ENDPOINT_ID)
 public class CamelRoutesMvcEndpoint extends EndpointMvcAdapter {
 
-    private static final ResponseEntity<?> NOT_FOUND = 
ResponseEntity.notFound().build();
+    /**
+     * Default path
+     */
+    public static final String PATH = "/camel/routes";
 
     private final CamelRoutesEndpoint delegate;
 
     public CamelRoutesMvcEndpoint(CamelRoutesEndpoint delegate) {
         super(delegate);
 
+        this.setPath(PATH);
         this.delegate = delegate;
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/7bbcb8a8/components/camel-spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
----------------------------------------------------------------------
diff --git 
a/components/camel-spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
 
b/components/camel-spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
index 5d17726..a389da9 100644
--- 
a/components/camel-spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
+++ 
b/components/camel-spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -10,7 +10,7 @@
       "name": "endpoints.camelroutes.enabled",
       "type": "java.lang.Boolean",
       "description": "Enable Camel Routes endpoint.",
-      "defaultValue": true
+      "defaultValue": false
     }
   ]
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/7bbcb8a8/examples/camel-example-spring-boot-routecontroller/readme.adoc
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-boot-routecontroller/readme.adoc 
b/examples/camel-example-spring-boot-routecontroller/readme.adoc
index 5b54d9c..9f26542 100644
--- a/examples/camel-example-spring-boot-routecontroller/readme.adoc
+++ b/examples/camel-example-spring-boot-routecontroller/readme.adoc
@@ -21,7 +21,7 @@ curl -XGET -s http://localhost:8080/camel/routes
 +
 [source]
 ----
-curl -XGET -s http://localhost:8080/camel/routes/${id}/info
+curl -XGET -s http://localhost:8080/camel/routes/{id}/info
 ----
 
 * To stop a route

http://git-wip-us.apache.org/repos/asf/camel/blob/7bbcb8a8/examples/camel-example-spring-boot-routecontroller/src/main/resources/application.properties
----------------------------------------------------------------------
diff --git 
a/examples/camel-example-spring-boot-routecontroller/src/main/resources/application.properties
 
b/examples/camel-example-spring-boot-routecontroller/src/main/resources/application.properties
index 89ea7d1..54d3318 100644
--- 
a/examples/camel-example-spring-boot-routecontroller/src/main/resources/application.properties
+++ 
b/examples/camel-example-spring-boot-routecontroller/src/main/resources/application.properties
@@ -26,8 +26,11 @@ logging.level.sample.camel = DEBUG
 endpoints.enabled = false
 endpoints.jmx.enabled = false
 endpoints.health.enabled = true
-endpoints.camelroutes.path = /camel/routes
-endpoints.camelroutes.enabled = true
+
+# camel routes is by default enabled
+# so you do not have to configure below
+# endpoints.camelroutes.path = /camel/routes
+# endpoints.camelroutes.enabled = true
 
 management.security.enabled = false
 

http://git-wip-us.apache.org/repos/asf/camel/blob/7bbcb8a8/examples/camel-example-spring-boot/readme.adoc
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-boot/readme.adoc 
b/examples/camel-example-spring-boot/readme.adoc
index 8520753..72475b2 100644
--- a/examples/camel-example-spring-boot/readme.adoc
+++ b/examples/camel-example-spring-boot/readme.adoc
@@ -21,6 +21,21 @@ You can run this example using
 
     mvn spring-boot:run
 
+## To get info about the routes
+
+To show a summary of all the routes
+
+----
+curl -XGET -s http://localhost:8080/camel/routes
+----
+
+To show detailed information for a specific route
+
+----
+curl -XGET -s http://localhost:8080/camel/routes/{id}/info
+----
+
+
 ## More information
 
 You can find more information about Apache Camel at the website: 
http://camel.apache.org/

http://git-wip-us.apache.org/repos/asf/camel/blob/7bbcb8a8/examples/camel-example-spring-boot/src/main/resources/application.properties
----------------------------------------------------------------------
diff --git 
a/examples/camel-example-spring-boot/src/main/resources/application.properties 
b/examples/camel-example-spring-boot/src/main/resources/application.properties
index 536ff0a..75a10de 100644
--- 
a/examples/camel-example-spring-boot/src/main/resources/application.properties
+++ 
b/examples/camel-example-spring-boot/src/main/resources/application.properties
@@ -33,3 +33,14 @@ greeting = Hello World
 
 # how often to trigger the timer
 timer.period = 2000
+
+# all access to actuator endpoints without security
+management.security.enabled = false
+# turn on actuator health check
+endpoints.health.enabled = true
+
+# to configure logging levels
+#logging.level.org.springframework = INFO
+#logging.level.org.apache.camel.spring.boot = INFO
+#logging.level.org.apache.camel.impl = DEBUG
+#logging.level.sample.camel = DEBUG

Reply via email to