You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/10/10 17:17:26 UTC

[GitHub] [camel-spring-boot-examples] joshiraez opened a new pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

joshiraez opened a new pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16


   This PR adds an example about using Actuator's capabilities to query info like metrics and mappings, and also shows how can we use it to shutdown our Spring application.
   
   [CAMEL-15323](https://issues.apache.org/jira/projects/CAMEL/issues/CAMEL-15323?filter=allopenissues)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez edited a comment on pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez edited a comment on pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#issuecomment-708457972


   I was afraid that I was missing some context from the ticket, because some stuff seemed contradictory.
   
   Alright, I guess we can have this PR, and I should create another example using Camel Actuator instead of Spring Boot's. 
   
   Sorry about that. I'll look how to add that Camel Actuator you passed me in the chat to the project and start with a new example them :sweat: 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r502841860



##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.rest.RestBindingMode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MyRouteBuilder extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+
+        // First, we have to configure our jetty component, which will be the rest
+        // in charge of querying the REST endpoints from actuator
+        restConfiguration().component("jetty")
+                .host("0.0.0.0")
+                .port(8080)
+                .bindingMode(RestBindingMode.json);
+
+        // First, let's show the routes we have exposed.
+        doOnce()

Review comment:
       Fixed on https://github.com/apache/camel-spring-boot-examples/pull/16/commits/3d62b7b657099614d9b8c01d0d5534d5b71f09ff 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r502841290



##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.rest.RestBindingMode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MyRouteBuilder extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+
+        // First, we have to configure our jetty component, which will be the rest
+        // in charge of querying the REST endpoints from actuator
+        restConfiguration().component("jetty")
+                .host("0.0.0.0")
+                .port(8080)
+                .bindingMode(RestBindingMode.json);
+
+        // First, let's show the routes we have exposed.
+        doOnce()
+                .to("rest:get:/actuator/mappings")
+                .unmarshal()
+                .json()
+                .to("log:INFO");
+
+        // Then, we will be querying the cpu consumption periodically. For more options, you can check
+        // https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html#production-ready-metrics-endpoint
+        from("timer:metricsTimer?period={{metricsPeriod}}")
+                .to("rest:get:/actuator/metrics/system.cpu.usage")
+                .unmarshal().json()
+                .to("log:INFO");
+
+        // Finally, let's see how to shutdown our application using the actuator endpoint
+        from("timer:shutdownTimer?delay={{shutdownTime}}&repeatCount=1")
+                .log("Shutting down")
+                .to("rest:post:/actuator/shutdown");
+
+

Review comment:
       Wops, fixing it now. Thanks!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] DenisIstomin commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
DenisIstomin commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r502841084



##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.rest.RestBindingMode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MyRouteBuilder extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+
+        // First, we have to configure our jetty component, which will be the rest
+        // in charge of querying the REST endpoints from actuator
+        restConfiguration().component("jetty")
+                .host("0.0.0.0")
+                .port(8080)
+                .bindingMode(RestBindingMode.json);
+
+        // First, let's show the routes we have exposed.
+        doOnce()
+                .to("rest:get:/actuator/mappings")
+                .unmarshal()
+                .json()
+                .to("log:INFO");
+
+        // Then, we will be querying the cpu consumption periodically. For more options, you can check
+        // https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html#production-ready-metrics-endpoint
+        from("timer:metricsTimer?period={{metricsPeriod}}")
+                .to("rest:get:/actuator/metrics/system.cpu.usage")
+                .unmarshal().json()
+                .to("log:INFO");
+
+        // Finally, let's see how to shutdown our application using the actuator endpoint
+        from("timer:shutdownTimer?delay={{shutdownTime}}&repeatCount=1")
+                .log("Shutting down")
+                .to("rest:post:/actuator/shutdown");
+
+

Review comment:
       NIT: extra newlines




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez edited a comment on pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez edited a comment on pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#issuecomment-708457972


   I was afraid that I was missing some context from the ticket, because some stuff seemed contradictory.
   
   Alright, I guess we can have this PR, and I should create another example using Camel Actuator instead of Spring Boot's. 
   
   
   But I'm still quite confused with what you mean with "Camel Actuator". I haven't seen any components or features in Camel called Camel Actuator from google or the documentation. The only thing that comes out is Spring Boot's Actuator.
   
   So I'm not quite sure if you mean something like this: https://tomd.xyz/camel-monitoring-with-rest/ ?? But Actuator didn't let any options for shutting down individual Camel routes.
   
   You sent me some code about Camel Actuator, but I was unable to see how to get access to / use that. You told me to get the book to understand how to be able to use that piece of code, but I can't afford it I'm afraid... :/


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r504728776



##########
File path: camel-example-spring-boot-actuator-http-metrics/pom.xml
##########
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel.springboot.example</groupId>
+        <artifactId>examples</artifactId>
+        <version>3.6.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-example-spring-boot-actuator-http-metrics</artifactId>
+    <name>Camel SB Examples :: Actuator HTTP Metrics</name>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <spring.boot-version>${spring-boot-version}</spring.boot-version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <!-- Spring Boot BOM -->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring.boot-version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <!-- Camel BOM -->
+            <dependency>
+                <groupId>org.apache.camel.springboot</groupId>
+                <artifactId>camel-spring-boot-dependencies</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <!-- Spring Boot -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <!-- Camel -->
+        <dependency>
+            <groupId>org.apache.camel.springboot</groupId>
+            <artifactId>camel-spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-http</artifactId>

Review comment:
       Sorry for being so late.
   
   The parent comment related to setting module/properties in POMs for Readme's is in commit 67b29a04b44e37a21ca784bdae75a55070a6beff . Thanks for telling me, I had no idea.
   
   About the dependencies, thanks a lot for pointing that out for me because I struggled a whole lot with that. Now I realized spring-boot uses the `-starter` artifact id and the base camel ones don't :open_mouth:  It's fixed on commit: f67ddebeadad707d23146ea3df2afa85f46bee4e
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez edited a comment on pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez edited a comment on pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#issuecomment-708457972


   @davsclaus Thanks. I was afraid that I was missing some context from the ticket, because some stuff seemed contradictory.
   
   Alright, I guess we can have this PR, and I should create another example using Camel Actuator instead of Spring Boot's. 
   
   
   But I'm still quite confused with what you mean with "Camel Actuator". I haven't seen any components or features in Camel called Camel Actuator from google or the documentation. The only thing that comes out is Spring Boot's Actuator.
   
   So I'm not quite sure if you mean something like this: https://tomd.xyz/camel-monitoring-with-rest/ ?? But Actuator didn't let any options for shutting down individual Camel routes.
   
   You sent me some code about Camel Actuator, but I was unable to see how to get access to / use that. You told me to get the book to understand how to be able to use that piece of code, but I can't afford it I'm afraid... :/


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r502841290



##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.rest.RestBindingMode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MyRouteBuilder extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+
+        // First, we have to configure our jetty component, which will be the rest
+        // in charge of querying the REST endpoints from actuator
+        restConfiguration().component("jetty")
+                .host("0.0.0.0")
+                .port(8080)
+                .bindingMode(RestBindingMode.json);
+
+        // First, let's show the routes we have exposed.
+        doOnce()
+                .to("rest:get:/actuator/mappings")
+                .unmarshal()
+                .json()
+                .to("log:INFO");
+
+        // Then, we will be querying the cpu consumption periodically. For more options, you can check
+        // https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html#production-ready-metrics-endpoint
+        from("timer:metricsTimer?period={{metricsPeriod}}")
+                .to("rest:get:/actuator/metrics/system.cpu.usage")
+                .unmarshal().json()
+                .to("log:INFO");
+
+        // Finally, let's see how to shutdown our application using the actuator endpoint
+        from("timer:shutdownTimer?delay={{shutdownTime}}&repeatCount=1")
+                .log("Shutting down")
+                .to("rest:post:/actuator/shutdown");
+
+

Review comment:
       Wops, fixing it now. Thanks!
   
   Edit: Fixed on 1beacaccf9e5e435195ef2f7d74174290a1a31e0




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] DenisIstomin commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
DenisIstomin commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r502841049



##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.rest.RestBindingMode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MyRouteBuilder extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+
+        // First, we have to configure our jetty component, which will be the rest
+        // in charge of querying the REST endpoints from actuator
+        restConfiguration().component("jetty")
+                .host("0.0.0.0")
+                .port(8080)
+                .bindingMode(RestBindingMode.json);
+
+        // First, let's show the routes we have exposed.
+        doOnce()

Review comment:
       Function `doOnce()` builds a `from("timer:queryTimer?repeatCount=1")` route definition,
   but below there are 2 route definitions, that are defined explicitly:
   1. `from("timer:metricsTimer?period={{metricsPeriod}}")`
   2. `from("timer:shutdownTimer?delay={{shutdownTime}}&repeatCount=1")`
   
   I think that that `doOnce` could be removed for consitency.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r504754663



##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.rest.RestBindingMode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MyRouteBuilder extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+
+        // First, we have to configure our jetty component, which will be the rest
+        // in charge of querying the REST endpoints from actuator
+        restConfiguration().component("jetty")
+                .host("0.0.0.0")
+                .port(8080)
+                .bindingMode(RestBindingMode.json);
+
+        // First, let's show the routes we have exposed. Let's create a timer
+        // consumer that will only fire once and show us the exposed mappings
+        from("timer:queryTimer?repeatCount=1")
+                .to("rest:get:/actuator/mappings")
+                .unmarshal()
+                .json()
+                .to("log:INFO");

Review comment:
       Added it and prettyprinted it, but it doesn't improve "much"?
   
   Like it doesn't pretty print past the first line. I think it's because it's not being mapped to any Java Class, I remember a similar issue with GSON in the past.
   
   I added it to the metrics call as well. Makes it easier to read (much more because is a much less nested json object)
   
   Commit is 96f127064d1e72ddd4dfb6b8f8c84851c14e1ba1




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez edited a comment on pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez edited a comment on pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#issuecomment-708457972


   @davsclaus Thanks. I was afraid that I was missing some context from the ticket, because some stuff seemed contradictory.
   
   Alright, I guess we can have this PR, and I should create another example using Camel Actuator instead of Spring Boot's. 
   
   
   But I'm still quite confused with what you mean with "Camel Actuator". I haven't seen any components or features in Camel called Camel Actuator from google or the documentation. The only thing that comes out is Spring Boot's Actuator.
   
   So I'm not quite sure if you mean something like this: https://tomd.xyz/camel-monitoring-with-rest/ ?? But Actuator didn't let any options for shutting down individual Camel routes.
   
   You sent me some code that seemed like it was related to this "Camel Actuator", but I was unable to see how to get access to / how to use that. You suggested me to pick up the book to understand how to use it, but I can't afford it I'm afraid... :/


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r504756565



##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;

Review comment:
       Ditto. 80aaec2548a71c8e7d72f62c03f84653c598835c .




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r504755331



##########
File path: camel-example-spring-boot-actuator-http-metrics/pom.xml
##########
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel.springboot.example</groupId>
+        <artifactId>examples</artifactId>
+        <version>3.6.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-example-spring-boot-actuator-http-metrics</artifactId>
+    <name>Camel SB Examples :: Actuator HTTP Metrics</name>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

Review comment:
       Changed it on 67b29a04b44e37a21ca784bdae75a55070a6beff and 38b7a8859d489f73c9264852edf27d0d9c66a2a3 . oops




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r504754663



##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.rest.RestBindingMode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MyRouteBuilder extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+
+        // First, we have to configure our jetty component, which will be the rest
+        // in charge of querying the REST endpoints from actuator
+        restConfiguration().component("jetty")
+                .host("0.0.0.0")
+                .port(8080)
+                .bindingMode(RestBindingMode.json);
+
+        // First, let's show the routes we have exposed. Let's create a timer
+        // consumer that will only fire once and show us the exposed mappings
+        from("timer:queryTimer?repeatCount=1")
+                .to("rest:get:/actuator/mappings")
+                .unmarshal()
+                .json()
+                .to("log:INFO");

Review comment:
       Added it and prettyprinted it, but it doesn't improve "much"?
   
   Like it doesn't pretty print past the first line. I think it's because it's not being mapped to any Java Class, I remember a similar issue with GSON in the past. Not sure if there is something I'm missing.
   
   I added it to the metrics call as well. Makes it easier to read (much more because is a much less nested json object)
   
   Commit is 96f127064d1e72ddd4dfb6b8f8c84851c14e1ba1




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] bedlaj commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
bedlaj commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r502967990



##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.rest.RestBindingMode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MyRouteBuilder extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+
+        // First, we have to configure our jetty component, which will be the rest
+        // in charge of querying the REST endpoints from actuator
+        restConfiguration().component("jetty")
+                .host("0.0.0.0")
+                .port(8080)
+                .bindingMode(RestBindingMode.json);
+
+        // First, let's show the routes we have exposed. Let's create a timer
+        // consumer that will only fire once and show us the exposed mappings
+        from("timer:queryTimer?repeatCount=1")
+                .to("rest:get:/actuator/mappings")
+                .unmarshal()
+                .json()
+                .to("log:INFO");

Review comment:
       You can use `multiline=true` option, which can be a bit easier to read.
   ```suggestion
                   .to("log:INFO?multiline=true");
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r504729054



##########
File path: camel-example-spring-boot-actuator-http-metrics/pom.xml
##########
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel.springboot.example</groupId>
+        <artifactId>examples</artifactId>
+        <version>3.6.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-example-spring-boot-actuator-http-metrics</artifactId>
+    <name>Camel SB Examples :: Actuator HTTP Metrics</name>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <spring.boot-version>${spring-boot-version}</spring.boot-version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <!-- Spring Boot BOM -->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring.boot-version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <!-- Camel BOM -->
+            <dependency>
+                <groupId>org.apache.camel.springboot</groupId>
+                <artifactId>camel-spring-boot-dependencies</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <!-- Spring Boot -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <!-- Camel -->
+        <dependency>
+            <groupId>org.apache.camel.springboot</groupId>
+            <artifactId>camel-spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-http</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-jackson</artifactId>

Review comment:
       Ditto. Done in f67ddebeadad707d23146ea3df2afa85f46bee4e




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r504756091



##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.rest.RestBindingMode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MyRouteBuilder extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+
+        // First, we have to configure our jetty component, which will be the rest
+        // in charge of querying the REST endpoints from actuator
+        restConfiguration().component("jetty")

Review comment:
       You are absolutely right. Thank you for pointing it out.
   
   Fixed on c31f1573a8f3e2edaa9e781beaf7a94c1375862d




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] bedlaj commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
bedlaj commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r502960083



##########
File path: camel-example-spring-boot-actuator-http-metrics/pom.xml
##########
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel.springboot.example</groupId>
+        <artifactId>examples</artifactId>
+        <version>3.6.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-example-spring-boot-actuator-http-metrics</artifactId>
+    <name>Camel SB Examples :: Actuator HTTP Metrics</name>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <spring.boot-version>${spring-boot-version}</spring.boot-version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <!-- Spring Boot BOM -->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring.boot-version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <!-- Camel BOM -->
+            <dependency>
+                <groupId>org.apache.camel.springboot</groupId>
+                <artifactId>camel-spring-boot-dependencies</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <!-- Spring Boot -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <!-- Camel -->
+        <dependency>
+            <groupId>org.apache.camel.springboot</groupId>
+            <artifactId>camel-spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-http</artifactId>

Review comment:
       Prefer starter dependencies in SB project. Like:
   ```
           <dependency>
               <groupId>org.apache.camel.springboot</groupId>
               <artifactId>camel-http-starter</artifactId>
           </dependency>
   ```

##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.rest.RestBindingMode;
+import org.springframework.beans.factory.annotation.Autowired;

Review comment:
       This seems unused

##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;

Review comment:
       This seems unused

##########
File path: camel-example-spring-boot-actuator-http-metrics/pom.xml
##########
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel.springboot.example</groupId>
+        <artifactId>examples</artifactId>
+        <version>3.6.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-example-spring-boot-actuator-http-metrics</artifactId>
+    <name>Camel SB Examples :: Actuator HTTP Metrics</name>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+        <spring.boot-version>${spring-boot-version}</spring.boot-version>
+    </properties>
+
+    <dependencyManagement>
+        <dependencies>
+            <!-- Spring Boot BOM -->
+            <dependency>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-dependencies</artifactId>
+                <version>${spring.boot-version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <!-- Camel BOM -->
+            <dependency>
+                <groupId>org.apache.camel.springboot</groupId>
+                <artifactId>camel-spring-boot-dependencies</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <!-- Spring Boot -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+        <!-- Camel -->
+        <dependency>
+            <groupId>org.apache.camel.springboot</groupId>
+            <artifactId>camel-spring-boot-starter</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-http</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-jackson</artifactId>

Review comment:
       Ditto, use `camel-jackson-starter`

##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.rest.RestBindingMode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MyRouteBuilder extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+
+        // First, we have to configure our jetty component, which will be the rest
+        // in charge of querying the REST endpoints from actuator
+        restConfiguration().component("jetty")

Review comment:
       You have no dependency to jetty in pom.xml. `.component("jetty")` can be removed, This works without that dependency only because Camel will use `camel-http` anyway instead of jetty, as jetty component is consumer only:
   https://camel.apache.org/components/latest/jetty-component.html
   > Only consumer is supported

##########
File path: camel-example-spring-boot-actuator-http-metrics/pom.xml
##########
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel.springboot.example</groupId>
+        <artifactId>examples</artifactId>
+        <version>3.6.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-example-spring-boot-actuator-http-metrics</artifactId>
+    <name>Camel SB Examples :: Actuator HTTP Metrics</name>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

Review comment:
       Please add `<category>Management and Monitoring</category>` and `<description>whatever</description>`. See other examples for inspiration. Tooling will then generate nice table to README.adoc - this does not need to be done manually in README, as you did.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r502841275



##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.rest.RestBindingMode;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class MyRouteBuilder extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+
+        // First, we have to configure our jetty component, which will be the rest
+        // in charge of querying the REST endpoints from actuator
+        restConfiguration().component("jetty")
+                .host("0.0.0.0")
+                .port(8080)
+                .bindingMode(RestBindingMode.json);
+
+        // First, let's show the routes we have exposed.
+        doOnce()

Review comment:
       Agreed. I used the doOnce function at first because I expected to use it as a fire for other routes, but it ended being used only in the mappings one. Although I like having well named functions, it really makes no sense when the others are built explicitly from properties Un_n.
   
   Gonna remove it. Let me a moment




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez commented on pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez commented on pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#issuecomment-709470343


   I was able to get ahold of the book so I'll start working on a new example for Camel-Actuator for the ticket. This example can be merged anyways if you'd like :)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] davsclaus commented on pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#issuecomment-707549020


   Okay this example only shows spring boot own actuator information.
   
   The JIRA ticket was about the Camel actuator where you can output Camel route details and if you turn on, be able to control routes. We had such example previously, and it was about adding that example back.
   
   But we can add this PR too - its just not the same.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez commented on pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez commented on pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#issuecomment-708457972


   I was afraid that I was missing some context from the ticket, because some stuff seemed contradictory.
   
   Alright, I guess we can have this PR, and I should create another example using Camel Actuator instead of Spring Boot's. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez edited a comment on pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez edited a comment on pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#issuecomment-708457972


   I was afraid that I was missing some context from the ticket, because some stuff seemed contradictory.
   
   Alright, I guess we can have this PR, and I should create another example using Camel Actuator instead of Spring Boot's. 
   
   
   But I'm still quite confused with what you mean with "Camel Actuator". I haven't seen any components or features in Camel called Camel Actuator from google or the documentation. The only thing that comes out is Spring Boot's Actuator.
   
   So I'm not quite sure if you mean something like this: https://tomd.xyz/camel-monitoring-with-rest/ ?? But Actuator didn't let any options for shutting down individual Camel routes.
   
   And you send me some code about Camel Actuator, but I was unable to see how to get access to that. You told me to get the book to understand how to be able to use that piece of code, but I can't afford it I'm afraid... :/


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] davsclaus merged pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
davsclaus merged pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-spring-boot-examples] joshiraez commented on a change in pull request #16: CAMEL-15323: Add example camel-spring-boot - http endpoint for route information

Posted by GitBox <gi...@apache.org>.
joshiraez commented on a change in pull request #16:
URL: https://github.com/apache/camel-spring-boot-examples/pull/16#discussion_r504756410



##########
File path: camel-example-spring-boot-actuator-http-metrics/src/main/java/sample/camel/MyRouteBuilder.java
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package sample.camel;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.RouteDefinition;
+import org.apache.camel.model.rest.RestBindingMode;
+import org.springframework.beans.factory.annotation.Autowired;

Review comment:
       Fixed this and the other unused import in 80aaec2548a71c8e7d72f62c03f84653c598835c. Thank you very much for spotting it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org