You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2017/08/30 08:17:16 UTC

[1/3] camel git commit: CAMEL-11714 - Add a Kubernetes Camel-gRPC spring-boot example

Repository: camel
Updated Branches:
  refs/heads/master 02b369800 -> 78b904ae6


CAMEL-11714 - Add a Kubernetes Camel-gRPC spring-boot example


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

Branch: refs/heads/master
Commit: 78b904ae604d9f757f77ce9c6ad10ffa7bb2b5ed
Parents: d8602f2
Author: Andrea Cosentino <an...@gmail.com>
Authored: Wed Aug 30 09:59:46 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Aug 30 10:16:28 2017 +0200

----------------------------------------------------------------------
 examples/README.adoc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/78b904ae/examples/README.adoc
----------------------------------------------------------------------
diff --git a/examples/README.adoc b/examples/README.adoc
index 1f10378..e6ba906 100644
--- a/examples/README.adoc
+++ b/examples/README.adoc
@@ -11,7 +11,7 @@ View the individual example READMEs for details.
 ### Examples
 
 // examples: START
-Number of Examples: 97 (8 deprecated)
+Number of Examples: 98 (8 deprecated)
 
 [width="100%",cols="4,2,4",options="header"]
 |=======================================================================
@@ -68,6 +68,8 @@ Number of Examples: 97 (8 deprecated)
 
 | link:camel-example-cdi-kubernetes/README.md[CDI Kubernetes] (camel-example-cdi-kubernetes) | Cloud | An example running Camel CDI on Kubernetes
 
+| link:camel-example-grpc-kubernetes/README.adoc[Grpc Kubernetes] (camel-example-grpc-kubernetes) | Cloud | An example showing the Camel gRPC component with Spring Boot running on Kubernetes
+
 | link:camel-example-hazelcast-kubernetes/ReadMe.md[Hazelcast Kubernetes] (camel-example-hazelcast-kubernetes) | Cloud | An example with Camel and Hazelcast running on Kubernetes
 
 | link:camel-example-spring-boot-grpc/README.adoc[Spring Boot Grpc] (camel-example-spring-boot-grpc) | Cloud | An example showing the Camel gRPC component with Spring Boot


[2/3] camel git commit: CAMEL-11714 - Add a Kubernetes Camel-gRPC spring-boot example

Posted by ac...@apache.org.
CAMEL-11714 - Add a Kubernetes Camel-gRPC spring-boot example


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

Branch: refs/heads/master
Commit: d8602f26dbbb8a5b5f11e07afd5f4d0242b87015
Parents: 2c5c8b6
Author: Andrea Cosentino <an...@gmail.com>
Authored: Wed Aug 30 09:44:08 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Aug 30 10:16:28 2017 +0200

----------------------------------------------------------------------
 .../camel-example-grpc-kubernetes/README.adoc   | 99 +++++++++++++++-----
 .../hello-camel-grpc-client-kubernetes/pom.xml  | 78 +++++++--------
 .../example/springboot/grpc/CamelGrpcRoute.java |  2 +-
 .../hello-camel-grpc-server-kubernetes/pom.xml  | 84 ++++++++++-------
 examples/pom.xml                                |  1 +
 5 files changed, 163 insertions(+), 101 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d8602f26/examples/camel-example-grpc-kubernetes/README.adoc
----------------------------------------------------------------------
diff --git a/examples/camel-example-grpc-kubernetes/README.adoc b/examples/camel-example-grpc-kubernetes/README.adoc
index 637d5b4..be041fa 100644
--- a/examples/camel-example-grpc-kubernetes/README.adoc
+++ b/examples/camel-example-grpc-kubernetes/README.adoc
@@ -1,8 +1,8 @@
-# Spring Boot Example with gRPC
+# Spring Boot Example with gRPC on Kubernetes
 
 ### Introduction
 
-This example demonstrates how you can use Camel-gRPC Starter component. The example is composed of a standalone gRPC server and a Camel Spring-boot gRPC route acting as client.
+This example demonstrates how you can use Camel-gRPC Starter component. The example is composed of a standalone gRPC server and a Camel Spring-boot gRPC route acting as client. We will run this example on Minikube (0.21.0)
 
 ### Server
 
@@ -12,14 +12,28 @@ You can build the server under the directory hello-camel-grpc-server with:
 
 and then run the server with
 
-    $ mvn exec:java
+    $ mvn -Pkubernetes-install fabric8:deploy
+
+then check your pod status with
+
+    $ kubectl get pods
+
+[source,bash]
+----
+NAME                                                          READY     STATUS    RESTARTS   AGE
+camel-example-hello-grpc-server-kubernetes-2604940788-g47hr   1/1       Running   0          13s
+----
+
+and get the logs
+
+    $ kubectl logs camel-example-hello-grpc-server-kubernetes-2604940788-g47hr
 
 You should see the following output:
 
 [source,bash]
 ----
-Aug 08, 2017 8:00:00 AM org.apache.camel.examples.grpc.HelloCamelServer start
-INFO: Server started. I'm listening on 50051
+Aug 30, 2017 7:31:11 AM org.apache.camel.examples.grpc.HelloCamelServer start
+INFO: Server started. I'm listening on 8080
 ----
 
 ### Run the client
@@ -28,32 +42,67 @@ You can build the client example under the directory hello-camel-grpc-client wit
 
     $ mvn clean install
 
-and then run the example with
+and then run the server with
+
+    $ mvn -Pkubernetes-install fabric8:deploy
+
+then check your pod status with
+
+    $ kubectl get pods
+
+[source,bash]
+----
+NAME                                                          READY     STATUS    RESTARTS   AGE
+camel-example-hello-grpc-client-kubernetes-1594657646-ptrkn   1/1       Running   0          15s
+camel-example-hello-grpc-server-kubernetes-2604940788-g47hr   1/1       Running   0          7m
+
+----
+
+and get the logs
 
-    $ mvn spring-boot:run
+    $ kubectl logs camel-example-hello-grpc-client-kubernetes-1594657646-ptrkn
 
 And you should see this output in the console.
 
 [source,bash]
 ----
-2017-08-08 08:01:14.530  INFO 7096 --- [           main] o.a.c.e.springboot.grpc.Application      : Starting Application on ghost with PID 7096 (/home/oscerd/workspace/apache-camel/camel/examples/camel-example-spring-boot-grpc/hello-camel-grpc-client/target/classes started by oscerd in /home/oscerd/workspace/apache-camel/camel/examples/camel-example-spring-boot-grpc/hello-camel-grpc-client)
-2017-08-08 08:01:14.532  INFO 7096 --- [           main] o.a.c.e.springboot.grpc.Application      : No active profile set, falling back to default profiles: default
-2017-08-08 08:01:14.563  INFO 7096 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@540ff973: startup date [Tue Aug 08 08:01:14 CEST 2017]; root of context hierarchy
-2017-08-08 08:01:15.177  INFO 7096 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.camel.spring.boot.CamelAutoConfiguration' of type [org.apache.camel.spring.boot.CamelAutoConfiguration$$EnhancerBySpringCGLIB$$78492c0f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
-2017-08-08 08:01:15.447  INFO 7096 --- [           main] o.a.c.i.converter.DefaultTypeConverter   : Type converters loaded (core: 192, classpath: 1)
-2017-08-08 08:01:15.844  INFO 7096 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
-2017-08-08 08:01:15.894  INFO 7096 --- [           main] o.a.camel.spring.boot.RoutesCollector    : Loading additional Camel XML routes from: classpath:camel/*.xml
-2017-08-08 08:01:15.894  INFO 7096 --- [           main] o.a.camel.spring.boot.RoutesCollector    : Loading additional Camel XML rests from: classpath:camel-rest/*.xml
-2017-08-08 08:01:15.895  INFO 7096 --- [           main] o.a.camel.spring.boot.RoutesCollector    : Starting CamelMainRunController to ensure the main thread keeps running
-2017-08-08 08:01:15.898  INFO 7096 --- [inRunController] o.a.camel.spring.SpringCamelContext      : Apache Camel 2.20.0-SNAPSHOT (CamelContext: gRPC) is starting
-2017-08-08 08:01:15.899  INFO 7096 --- [inRunController] o.a.c.m.ManagedManagementStrategy        : JMX is enabled
-2017-08-08 08:01:15.904  INFO 7096 --- [           main] o.a.c.e.springboot.grpc.Application      : Started Application in 1.897 seconds (JVM running for 7.75)
-2017-08-08 08:01:16.074  INFO 7096 --- [inRunController] o.a.camel.spring.SpringCamelContext      : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
-2017-08-08 08:01:16.118  INFO 7096 --- [inRunController] o.a.camel.component.grpc.GrpcProducer    : Creating channel to the remote gRPC server localhost:50051
-2017-08-08 08:01:16.214  INFO 7096 --- [inRunController] o.a.camel.spring.SpringCamelContext      : Route: route1 started and consuming from: timer://foo?period=10000&repeatCount=1
-2017-08-08 08:01:16.216  INFO 7096 --- [inRunController] o.a.camel.spring.SpringCamelContext      : Total 1 routes, of which 1 are started.
-2017-08-08 08:01:16.216  INFO 7096 --- [inRunController] o.a.camel.spring.SpringCamelContext      : Apache Camel 2.20.0-SNAPSHOT (CamelContext: gRPC) started in 0.319 seconds
-2017-08-08 08:01:17.534  INFO 7096 --- [2 - timer://foo] route1                                   : Received message: "Hello Camel"
+2017-08-30 07:38:50.753:INFO:ifasjipjsoejs.Server:jetty-8.y.z-SNAPSHOT
+2017-08-30 07:38:50.787:INFO:ifasjipjsoejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:9779
+
+  .   ____          _            __ _ _
+ /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
+( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
+ \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
+  '  |____| .__|_| |_|_| |_\__, | / / / /
+ =========|_|==============|___/=/_/_/_/
+ :: Spring Boot ::        (v1.5.6.RELEASE)
+
+2017-08-30 07:38:51.742  INFO 1 --- [           main] o.a.c.e.springboot.grpc.Application      : Starting Application v2.20.0-SNAPSHOT on camel-example-hello-grpc-client-kubernetes-1594657646-ptrkn with PID 1 (/deployments/camel-example-hello-grpc-client-kubernetes-2.20.0-SNAPSHOT.jar started by root in /deployments)
+2017-08-30 07:38:51.744  INFO 1 --- [           main] o.a.c.e.springboot.grpc.Application      : No active profile set, falling back to default profiles: default
+2017-08-30 07:38:51.899  INFO 1 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@5faeada1: startup date [Wed Aug 30 07:38:51 GMT 2017]; root of context hierarchy
+2017-08-30 07:38:53.236  INFO 1 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.camel.spring.boot.CamelAutoConfiguration' of type [org.apache.camel.spring.boot.CamelAutoConfiguration$$EnhancerBySpringCGLIB$$bd99dea4] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
+2017-08-30 07:38:54.109  INFO 1 --- [           main] o.a.c.i.converter.DefaultTypeConverter   : Type converters loaded (core: 192, classpath: 1)
+2017-08-30 07:38:54.906  INFO 1 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
+2017-08-30 07:38:54.976  INFO 1 --- [           main] o.a.camel.spring.boot.RoutesCollector    : Loading additional Camel XML routes from: classpath:camel/*.xml
+2017-08-30 07:38:54.977  INFO 1 --- [           main] o.a.camel.spring.boot.RoutesCollector    : Loading additional Camel XML rests from: classpath:camel-rest/*.xml
+2017-08-30 07:38:54.977  INFO 1 --- [           main] o.a.camel.spring.boot.RoutesCollector    : Starting CamelMainRunController to ensure the main thread keeps running
+2017-08-30 07:38:54.980  INFO 1 --- [inRunController] o.a.camel.spring.SpringCamelContext      : Apache Camel 2.20.0-SNAPSHOT (CamelContext: gRPC) is starting
+2017-08-30 07:38:54.983  INFO 1 --- [inRunController] o.a.c.m.ManagedManagementStrategy        : JMX is enabled
+2017-08-30 07:38:55.005  INFO 1 --- [           main] o.a.c.e.springboot.grpc.Application      : Started Application in 3.745 seconds (JVM running for 4.657)
+2017-08-30 07:38:55.308  INFO 1 --- [inRunController] o.a.camel.spring.SpringCamelContext      : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
+2017-08-30 07:38:55.387  INFO 1 --- [inRunController] o.a.camel.component.grpc.GrpcProducer    : Creating channel to the remote gRPC server grpc-server:80
+2017-08-30 07:38:55.544  INFO 1 --- [inRunController] o.a.camel.spring.SpringCamelContext      : Route: route1 started and consuming from: timer://foo?period=10000&repeatCount=5
+2017-08-30 07:38:55.545  INFO 1 --- [inRunController] o.a.camel.spring.SpringCamelContext      : Total 1 routes, of which 1 are started
+2017-08-30 07:38:55.546  INFO 1 --- [inRunController] o.a.camel.spring.SpringCamelContext      : Apache Camel 2.20.0-SNAPSHOT (CamelContext: gRPC) started in 0.565 seconds
+2017-08-30 07:38:57.443  INFO 1 --- [2 - timer://foo] route1                                   : Received message: "Hello Camel"
+
+2017-08-30 07:39:06.556  INFO 1 --- [2 - timer://foo] route1                                   : Received message: "Hello Camel"
+
+2017-08-30 07:39:16.551  INFO 1 --- [2 - timer://foo] route1                                   : Received message: "Hello Camel"
+
+2017-08-30 07:39:26.551  INFO 1 --- [2 - timer://foo] route1                                   : Received message: "Hello Camel"
+
+2017-08-30 07:39:36.551  INFO 1 --- [2 - timer://foo] route1                                   : Received message: "Hello Camel"
 
 ----
 

http://git-wip-us.apache.org/repos/asf/camel/blob/d8602f26/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/pom.xml b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/pom.xml
index c67edd6..c1717d2 100644
--- a/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/pom.xml
+++ b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/pom.xml
@@ -115,48 +115,48 @@
 		</plugins>
 	</build>
 
-  <profiles>
-  <profile>
-  <id>kubernetes-install</id>
+	<profiles>
+		<profile>
+			<id>kubernetes-install</id>
 
-  <build>
-    <defaultGoal>install</defaultGoal>
+			<build>
+				<defaultGoal>install</defaultGoal>
 
-    <plugins>
+				<plugins>
 
-      <plugin>
-        <groupId>io.fabric8</groupId>
-        <artifactId>fabric8-maven-plugin</artifactId>
-        <version>3.2.31</version>
-        <configuration>
-          <generator>
-            <config>
-              <java-exec>
-                <mainClass>org.apache.camel.example.springboot.grpc.Application</mainClass>
-              </java-exec>
-            </config>
-          </generator>
-  <enricher>
-    <config>
-      <fmp-service>
-        <name>grpc-client</name>
-      </fmp-service>
-    </config>
-  </enricher>
-        </configuration>
-        <executions>
-          <execution>
-            <goals>
-              <goal>resource</goal>
-              <goal>build</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
+					<plugin>
+						<groupId>io.fabric8</groupId>
+						<artifactId>fabric8-maven-plugin</artifactId>
+						<version>3.2.31</version>
+						<configuration>
+							<generator>
+								<config>
+									<java-exec>
+										<mainClass>org.apache.camel.example.springboot.grpc.Application</mainClass>
+									</java-exec>
+								</config>
+							</generator>
+							<enricher>
+								<config>
+									<fmp-service>
+										<name>grpc-client</name>
+									</fmp-service>
+								</config>
+							</enricher>
+						</configuration>
+						<executions>
+							<execution>
+								<goals>
+									<goal>resource</goal>
+									<goal>build</goal>
+								</goals>
+							</execution>
+						</executions>
+					</plugin>
 
-    </plugins>
-  </build>
-  </profile>
- </profiles>
+				</plugins>
+			</build>
+		</profile>
+	</profiles>
 
 </project>

http://git-wip-us.apache.org/repos/asf/camel/blob/d8602f26/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/java/org/apache/camel/example/springboot/grpc/CamelGrpcRoute.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/java/org/apache/camel/example/springboot/grpc/CamelGrpcRoute.java b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/java/org/apache/camel/example/springboot/grpc/CamelGrpcRoute.java
index 95d40f6..864a880 100644
--- a/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/java/org/apache/camel/example/springboot/grpc/CamelGrpcRoute.java
+++ b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/java/org/apache/camel/example/springboot/grpc/CamelGrpcRoute.java
@@ -32,7 +32,7 @@ public class CamelGrpcRoute extends RouteBuilder {
     public void configure() throws Exception {
 
         CamelHelloRequest request = CamelHelloRequest.newBuilder().setName("Camel").build();
-        from("timer://foo?period=10000&repeatCount=1").process(new Processor() {
+        from("timer://foo?period=10000&repeatCount=5").process(new Processor() {
 
             @Override
             public void process(Exchange exchange) throws Exception {

http://git-wip-us.apache.org/repos/asf/camel/blob/d8602f26/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/pom.xml b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/pom.xml
index 4616874..16b456b 100644
--- a/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/pom.xml
+++ b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/pom.xml
@@ -11,9 +11,9 @@
 	<name>Camel :: Example :: gRPC :: Hello Camel Server Kubernetes</name>
 	<description>An example showing a simple gRPC server running on Kubernetes</description>
 
-    <properties>
-        <main.class>org.apache.camel.examples.grpc.HelloCamelServer</main.class>
-    </properties>
+	<properties>
+		<main.class>org.apache.camel.examples.grpc.HelloCamelServer</main.class>
+	</properties>
 
 	<dependencies>
 		<dependency>
@@ -86,43 +86,55 @@
 					<includePluginDependencies>false</includePluginDependencies>
 				</configuration>
 			</plugin>
+			<plugin>
+				<!-- Build an executable JAR -->
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<version>2.4</version>
+				<configuration>
+					<archive>
+						<manifest>
+							<mainClass>org.apache.camel.examples.grpc.HelloCamelServer</mainClass>
+						</manifest>
+					</archive>
+				</configuration>
+			</plugin>
 		</plugins>
 	</build>
 
-  <profiles>
-  <profile>
-  <id>kubernetes-install</id>
-
-  <build>
-    <defaultGoal>install</defaultGoal>
+	<profiles>
+		<profile>
+			<id>kubernetes-install</id>
 
-    <plugins>
+			<build>
+				<defaultGoal>install</defaultGoal>
 
-      <plugin>
-        <groupId>io.fabric8</groupId>
-        <artifactId>fabric8-maven-plugin</artifactId>
-        <version>3.2.31</version>
-        <configuration>
-  <enricher>
-    <config>
-      <fmp-service>
-        <name>grpc-server</name>
-      </fmp-service>
-    </config>
-  </enricher>
-        </configuration>
-        <executions>
-          <execution>
-            <goals>
-              <goal>resource</goal>
-              <goal>build</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
+				<plugins>
 
-    </plugins>
-  </build>
-  </profile>
- </profiles>
+					<plugin>
+						<groupId>io.fabric8</groupId>
+						<artifactId>fabric8-maven-plugin</artifactId>
+						<version>3.2.31</version>
+						<configuration>
+							<enricher>
+								<config>
+									<fmp-service>
+										<name>grpc-server</name>
+									</fmp-service>
+								</config>
+							</enricher>
+						</configuration>
+						<executions>
+							<execution>
+								<goals>
+									<goal>resource</goal>
+									<goal>build</goal>
+								</goals>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+	</profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/camel/blob/d8602f26/examples/pom.xml
----------------------------------------------------------------------
diff --git a/examples/pom.xml b/examples/pom.xml
index 7a4441b..88e11b7 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -61,6 +61,7 @@
     <module>camel-example-google-pubsub</module>
     <module>camel-example-guice-jms</module>
     <module>camel-example-groovy</module>
+    <module>camel-example-grpc-kubernetes</module>
     <module>camel-example-hazelcast-kubernetes</module>
     <module>camel-example-hystrix</module>
     <module>camel-example-java8</module>


[3/3] camel git commit: CAMEL-11714 - Add a Kubernetes Camel-gRPC spring-boot example

Posted by ac...@apache.org.
CAMEL-11714 - Add a Kubernetes Camel-gRPC spring-boot example


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

Branch: refs/heads/master
Commit: 2c5c8b6d7ba95e9173572cde7b6e8c3490218d79
Parents: 02b3698
Author: Andrea Cosentino <an...@gmail.com>
Authored: Tue Aug 29 16:03:43 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Wed Aug 30 10:16:28 2017 +0200

----------------------------------------------------------------------
 .../camel-example-grpc-kubernetes/README.adoc   |  66 ++++++++
 .../hello-camel-grpc-client-kubernetes/pom.xml  | 162 +++++++++++++++++++
 .../example/springboot/grpc/Application.java    |  34 ++++
 .../example/springboot/grpc/CamelGrpcRoute.java |  45 ++++++
 .../src/main/proto/hellocamel.proto             |  39 +++++
 .../src/main/resources/application.properties   |  19 +++
 .../hello-camel-grpc-server-kubernetes/pom.xml  | 128 +++++++++++++++
 .../camel/examples/grpc/HelloCamelServer.java   |  82 ++++++++++
 .../src/main/proto/hellocamel.proto             |  39 +++++
 examples/camel-example-grpc-kubernetes/pom.xml  |  45 ++++++
 10 files changed, 659 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2c5c8b6d/examples/camel-example-grpc-kubernetes/README.adoc
----------------------------------------------------------------------
diff --git a/examples/camel-example-grpc-kubernetes/README.adoc b/examples/camel-example-grpc-kubernetes/README.adoc
new file mode 100644
index 0000000..637d5b4
--- /dev/null
+++ b/examples/camel-example-grpc-kubernetes/README.adoc
@@ -0,0 +1,66 @@
+# Spring Boot Example with gRPC
+
+### Introduction
+
+This example demonstrates how you can use Camel-gRPC Starter component. The example is composed of a standalone gRPC server and a Camel Spring-boot gRPC route acting as client.
+
+### Server
+
+You can build the server under the directory hello-camel-grpc-server with:
+
+    $ mvn clean install 
+
+and then run the server with
+
+    $ mvn exec:java
+
+You should see the following output:
+
+[source,bash]
+----
+Aug 08, 2017 8:00:00 AM org.apache.camel.examples.grpc.HelloCamelServer start
+INFO: Server started. I'm listening on 50051
+----
+
+### Run the client
+
+You can build the client example under the directory hello-camel-grpc-client with:
+
+    $ mvn clean install
+
+and then run the example with
+
+    $ mvn spring-boot:run
+
+And you should see this output in the console.
+
+[source,bash]
+----
+2017-08-08 08:01:14.530  INFO 7096 --- [           main] o.a.c.e.springboot.grpc.Application      : Starting Application on ghost with PID 7096 (/home/oscerd/workspace/apache-camel/camel/examples/camel-example-spring-boot-grpc/hello-camel-grpc-client/target/classes started by oscerd in /home/oscerd/workspace/apache-camel/camel/examples/camel-example-spring-boot-grpc/hello-camel-grpc-client)
+2017-08-08 08:01:14.532  INFO 7096 --- [           main] o.a.c.e.springboot.grpc.Application      : No active profile set, falling back to default profiles: default
+2017-08-08 08:01:14.563  INFO 7096 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@540ff973: startup date [Tue Aug 08 08:01:14 CEST 2017]; root of context hierarchy
+2017-08-08 08:01:15.177  INFO 7096 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.camel.spring.boot.CamelAutoConfiguration' of type [org.apache.camel.spring.boot.CamelAutoConfiguration$$EnhancerBySpringCGLIB$$78492c0f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
+2017-08-08 08:01:15.447  INFO 7096 --- [           main] o.a.c.i.converter.DefaultTypeConverter   : Type converters loaded (core: 192, classpath: 1)
+2017-08-08 08:01:15.844  INFO 7096 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
+2017-08-08 08:01:15.894  INFO 7096 --- [           main] o.a.camel.spring.boot.RoutesCollector    : Loading additional Camel XML routes from: classpath:camel/*.xml
+2017-08-08 08:01:15.894  INFO 7096 --- [           main] o.a.camel.spring.boot.RoutesCollector    : Loading additional Camel XML rests from: classpath:camel-rest/*.xml
+2017-08-08 08:01:15.895  INFO 7096 --- [           main] o.a.camel.spring.boot.RoutesCollector    : Starting CamelMainRunController to ensure the main thread keeps running
+2017-08-08 08:01:15.898  INFO 7096 --- [inRunController] o.a.camel.spring.SpringCamelContext      : Apache Camel 2.20.0-SNAPSHOT (CamelContext: gRPC) is starting
+2017-08-08 08:01:15.899  INFO 7096 --- [inRunController] o.a.c.m.ManagedManagementStrategy        : JMX is enabled
+2017-08-08 08:01:15.904  INFO 7096 --- [           main] o.a.c.e.springboot.grpc.Application      : Started Application in 1.897 seconds (JVM running for 7.75)
+2017-08-08 08:01:16.074  INFO 7096 --- [inRunController] o.a.camel.spring.SpringCamelContext      : StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
+2017-08-08 08:01:16.118  INFO 7096 --- [inRunController] o.a.camel.component.grpc.GrpcProducer    : Creating channel to the remote gRPC server localhost:50051
+2017-08-08 08:01:16.214  INFO 7096 --- [inRunController] o.a.camel.spring.SpringCamelContext      : Route: route1 started and consuming from: timer://foo?period=10000&repeatCount=1
+2017-08-08 08:01:16.216  INFO 7096 --- [inRunController] o.a.camel.spring.SpringCamelContext      : Total 1 routes, of which 1 are started.
+2017-08-08 08:01:16.216  INFO 7096 --- [inRunController] o.a.camel.spring.SpringCamelContext      : Apache Camel 2.20.0-SNAPSHOT (CamelContext: gRPC) started in 0.319 seconds
+2017-08-08 08:01:17.534  INFO 7096 --- [2 - timer://foo] route1                                   : Received message: "Hello Camel"
+
+----
+
+### Help
+
+If you hit any problems please let us know on the http://camel.apache.org/discussion-forums.html[Camel Forums].
+
+Please help us make Apache Camel better - we appreciate any feedback you may have. Enjoy!
+
+The Camel riders!

http://git-wip-us.apache.org/repos/asf/camel/blob/2c5c8b6d/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/pom.xml b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/pom.xml
new file mode 100644
index 0000000..c67edd6
--- /dev/null
+++ b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/pom.xml
@@ -0,0 +1,162 @@
+<?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/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.camel.example</groupId>
+		<artifactId>camel-example-grpc-kubernetes</artifactId>
+		<version>2.20.0-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>camel-example-hello-grpc-client-kubernetes</artifactId>
+	<name>Camel :: Example :: gRPC :: Hello Camel Client Kubernetes</name>
+	<description>An example showing the Camel Grpc component with Spring Boot runnning on Kubernetes</description>
+
+	<properties>
+		<category>Cloud</category>
+		<spring.boot-version>${spring-boot-version}</spring.boot-version>
+	</properties>
+
+	<!-- Spring-Boot and Camel BOM -->
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-dependencies</artifactId>
+				<version>${spring.boot-version}</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+			<dependency>
+				<groupId>org.apache.camel</groupId>
+				<artifactId>camel-parent</artifactId>
+				<version>${project.version}</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+
+	<dependencies>
+
+		<!-- Camel -->
+		<dependency>
+			<groupId>org.apache.camel</groupId>
+			<artifactId>camel-spring-boot-starter</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.camel</groupId>
+			<artifactId>camel-grpc-starter</artifactId>
+		</dependency>
+
+		<!-- Test -->
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-test</artifactId>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.camel</groupId>
+			<artifactId>camel-test</artifactId>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+
+	<build>
+		<extensions>
+			<extension>
+				<groupId>kr.motd.maven</groupId>
+				<artifactId>os-maven-plugin</artifactId>
+				<version>1.5.0.Final</version>
+			</extension>
+		</extensions>
+		<plugins>
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+				<version>${spring.boot-version}</version>
+				<executions>
+					<execution>
+						<goals>
+							<goal>repackage</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.xolstice.maven.plugins</groupId>
+				<artifactId>protobuf-maven-plugin</artifactId>
+				<version>${protobuf-maven-plugin-version}</version>
+				<configuration>
+					<protocArtifact>com.google.protobuf:protoc:3.3.0:exe:${os.detected.classifier}</protocArtifact>
+					<pluginId>grpc-java</pluginId>
+					<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc-version}:exe:${os.detected.classifier}</pluginArtifact>
+				</configuration>
+				<executions>
+					<execution>
+						<goals>
+							<goal>compile</goal>
+							<goal>compile-custom</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+
+  <profiles>
+  <profile>
+  <id>kubernetes-install</id>
+
+  <build>
+    <defaultGoal>install</defaultGoal>
+
+    <plugins>
+
+      <plugin>
+        <groupId>io.fabric8</groupId>
+        <artifactId>fabric8-maven-plugin</artifactId>
+        <version>3.2.31</version>
+        <configuration>
+          <generator>
+            <config>
+              <java-exec>
+                <mainClass>org.apache.camel.example.springboot.grpc.Application</mainClass>
+              </java-exec>
+            </config>
+          </generator>
+  <enricher>
+    <config>
+      <fmp-service>
+        <name>grpc-client</name>
+      </fmp-service>
+    </config>
+  </enricher>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>resource</goal>
+              <goal>build</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+    </plugins>
+  </build>
+  </profile>
+ </profiles>
+
+</project>

http://git-wip-us.apache.org/repos/asf/camel/blob/2c5c8b6d/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/java/org/apache/camel/example/springboot/grpc/Application.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/java/org/apache/camel/example/springboot/grpc/Application.java b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/java/org/apache/camel/example/springboot/grpc/Application.java
new file mode 100644
index 0000000..5300c92
--- /dev/null
+++ b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/java/org/apache/camel/example/springboot/grpc/Application.java
@@ -0,0 +1,34 @@
+/**
+ * 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 org.apache.camel.example.springboot.grpc;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+// CHECKSTYLE:OFF
+@SpringBootApplication
+public class Application {
+
+    /**
+     * Main method to start the application.
+     */
+    public static void main(String[] args) {
+        SpringApplication.run(Application.class, args);
+    }
+
+}
+// CHECKSTYLE:ON

http://git-wip-us.apache.org/repos/asf/camel/blob/2c5c8b6d/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/java/org/apache/camel/example/springboot/grpc/CamelGrpcRoute.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/java/org/apache/camel/example/springboot/grpc/CamelGrpcRoute.java b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/java/org/apache/camel/example/springboot/grpc/CamelGrpcRoute.java
new file mode 100644
index 0000000..95d40f6
--- /dev/null
+++ b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/java/org/apache/camel/example/springboot/grpc/CamelGrpcRoute.java
@@ -0,0 +1,45 @@
+/**
+ * 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 org.apache.camel.example.springboot.grpc;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.examples.CamelHelloRequest;
+import org.springframework.stereotype.Component;
+
+/**
+ * A simple Camel Grpc route example using Spring-boot
+ */
+@Component
+public class CamelGrpcRoute extends RouteBuilder {
+
+    @Override
+    public void configure() throws Exception {
+
+        CamelHelloRequest request = CamelHelloRequest.newBuilder().setName("Camel").build();
+        from("timer://foo?period=10000&repeatCount=1").process(new Processor() {
+
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setBody(request, CamelHelloRequest.class);
+
+            }
+        }).to("grpc://grpc-server:80/org.apache.camel.examples.CamelHello?method=sayHelloToCamel&synchronous=true").log("Received ${body}");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/2c5c8b6d/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/proto/hellocamel.proto
----------------------------------------------------------------------
diff --git a/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/proto/hellocamel.proto b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/proto/hellocamel.proto
new file mode 100644
index 0000000..787ae12
--- /dev/null
+++ b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/proto/hellocamel.proto
@@ -0,0 +1,39 @@
+/**
+ * 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.
+ */
+syntax = "proto3";
+
+option java_multiple_files = true;
+option java_package = "org.apache.camel.examples";
+option java_outer_classname = "HelloCamelProto";
+
+package org.apache.camel.examples;
+
+// The camel hello service definition.
+service CamelHello {
+  // Sends a greeting
+  rpc SayHelloToCamel (CamelHelloRequest) returns (CamelHelloReply) {}
+}
+
+// The request message containing the user's name.
+message CamelHelloRequest {
+  string name = 1;
+}
+
+// The response message containing the greetings
+message CamelHelloReply {
+  string message = 1;
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/2c5c8b6d/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/resources/application.properties
----------------------------------------------------------------------
diff --git a/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/resources/application.properties b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/resources/application.properties
new file mode 100644
index 0000000..fbf3831
--- /dev/null
+++ b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-client-kubernetes/src/main/resources/application.properties
@@ -0,0 +1,19 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+camel.springboot.name=gRPC
+camel.springboot.main-run-controller=true

http://git-wip-us.apache.org/repos/asf/camel/blob/2c5c8b6d/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/pom.xml b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/pom.xml
new file mode 100644
index 0000000..4616874
--- /dev/null
+++ b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/pom.xml
@@ -0,0 +1,128 @@
+<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.example</groupId>
+		<artifactId>camel-example-grpc-kubernetes</artifactId>
+		<version>2.20.0-SNAPSHOT</version>
+	</parent>
+
+	<artifactId>camel-example-hello-grpc-server-kubernetes</artifactId>
+	<name>Camel :: Example :: gRPC :: Hello Camel Server Kubernetes</name>
+	<description>An example showing a simple gRPC server running on Kubernetes</description>
+
+    <properties>
+        <main.class>org.apache.camel.examples.grpc.HelloCamelServer</main.class>
+    </properties>
+
+	<dependencies>
+		<dependency>
+			<groupId>io.grpc</groupId>
+			<artifactId>grpc-netty</artifactId>
+			<version>${grpc-version}</version>
+		</dependency>
+		<dependency>
+			<groupId>io.grpc</groupId>
+			<artifactId>grpc-protobuf</artifactId>
+			<version>${grpc-version}</version>
+		</dependency>
+		<dependency>
+			<groupId>io.grpc</groupId>
+			<artifactId>grpc-stub</artifactId>
+			<version>${grpc-version}</version>
+		</dependency>
+	</dependencies>
+	<build>
+		<extensions>
+			<extension>
+				<groupId>kr.motd.maven</groupId>
+				<artifactId>os-maven-plugin</artifactId>
+				<version>1.5.0.Final</version>
+			</extension>
+		</extensions>
+		<plugins>
+			<plugin>
+				<groupId>org.xolstice.maven.plugins</groupId>
+				<artifactId>protobuf-maven-plugin</artifactId>
+				<version>${protobuf-maven-plugin-version}</version>
+				<configuration>
+					<protocArtifact>com.google.protobuf:protoc:3.3.0:exe:${os.detected.classifier}</protocArtifact>
+					<pluginId>grpc-java</pluginId>
+					<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc-version}:exe:${os.detected.classifier}</pluginArtifact>
+				</configuration>
+				<executions>
+					<execution>
+						<goals>
+							<goal>compile</goal>
+							<goal>compile-custom</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-enforcer-plugin</artifactId>
+				<version>1.4.1</version>
+				<executions>
+					<execution>
+						<id>enforce</id>
+						<goals>
+							<goal>enforce</goal>
+						</goals>
+						<configuration>
+							<rules>
+								<requireUpperBoundDeps />
+							</rules>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>exec-maven-plugin</artifactId>
+				<version>${exec-maven-plugin-version}</version>
+				<configuration>
+					<mainClass>org.apache.camel.examples.grpc.HelloCamelServer</mainClass>
+					<includePluginDependencies>false</includePluginDependencies>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+  <profiles>
+  <profile>
+  <id>kubernetes-install</id>
+
+  <build>
+    <defaultGoal>install</defaultGoal>
+
+    <plugins>
+
+      <plugin>
+        <groupId>io.fabric8</groupId>
+        <artifactId>fabric8-maven-plugin</artifactId>
+        <version>3.2.31</version>
+        <configuration>
+  <enricher>
+    <config>
+      <fmp-service>
+        <name>grpc-server</name>
+      </fmp-service>
+    </config>
+  </enricher>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>resource</goal>
+              <goal>build</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+    </plugins>
+  </build>
+  </profile>
+ </profiles>
+</project>

http://git-wip-us.apache.org/repos/asf/camel/blob/2c5c8b6d/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/src/main/java/org/apache/camel/examples/grpc/HelloCamelServer.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/src/main/java/org/apache/camel/examples/grpc/HelloCamelServer.java b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/src/main/java/org/apache/camel/examples/grpc/HelloCamelServer.java
new file mode 100644
index 0000000..9fa0c1a
--- /dev/null
+++ b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/src/main/java/org/apache/camel/examples/grpc/HelloCamelServer.java
@@ -0,0 +1,82 @@
+/**
+ * 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 org.apache.camel.examples.grpc;
+
+import java.io.IOException;
+import java.util.logging.Logger;
+
+import io.grpc.Server;
+import io.grpc.ServerBuilder;
+import io.grpc.stub.StreamObserver;
+
+import org.apache.camel.examples.CamelHelloGrpc;
+import org.apache.camel.examples.CamelHelloReply;
+import org.apache.camel.examples.CamelHelloRequest;
+
+/**
+ * Server that manages startup/shutdown of a server.
+ */
+public class HelloCamelServer {
+    private static final Logger LOG = Logger.getLogger(HelloCamelServer.class.getName());
+
+    private Server server;
+
+    private void start() throws IOException {
+        /* The port on which the server should run */
+        int port = 8080;
+        server = ServerBuilder.forPort(port).addService(new HelloCamelImpl()).build().start();
+        LOG.info("Server started. I'm listening on " + port);
+        Runtime.getRuntime().addShutdownHook(new Thread() {
+            @Override
+            public void run() {
+                HelloCamelServer.this.stop();
+            }
+        });
+    }
+
+    private void stop() {
+        if (server != null) {
+            server.shutdown();
+        }
+    }
+
+    private void blockUntilShutdown() throws InterruptedException {
+        if (server != null) {
+            server.awaitTermination();
+        }
+    }
+
+    /**
+     * Main needed to launch server from command line
+     */
+    public static void main(String[] args) throws IOException, InterruptedException {
+        final HelloCamelServer server = new HelloCamelServer();
+        server.start();
+        server.blockUntilShutdown();
+    }
+
+    static class HelloCamelImpl extends CamelHelloGrpc.CamelHelloImplBase {
+
+        @Override
+        public void sayHelloToCamel(CamelHelloRequest req, StreamObserver<CamelHelloReply> responseObserver) {
+            CamelHelloReply reply = CamelHelloReply.newBuilder().setMessage("Hello " + req.getName()).build();
+            responseObserver.onNext(reply);
+            responseObserver.onCompleted();
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/2c5c8b6d/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/src/main/proto/hellocamel.proto
----------------------------------------------------------------------
diff --git a/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/src/main/proto/hellocamel.proto b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/src/main/proto/hellocamel.proto
new file mode 100644
index 0000000..787ae12
--- /dev/null
+++ b/examples/camel-example-grpc-kubernetes/hello-camel-grpc-server-kubernetes/src/main/proto/hellocamel.proto
@@ -0,0 +1,39 @@
+/**
+ * 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.
+ */
+syntax = "proto3";
+
+option java_multiple_files = true;
+option java_package = "org.apache.camel.examples";
+option java_outer_classname = "HelloCamelProto";
+
+package org.apache.camel.examples;
+
+// The camel hello service definition.
+service CamelHello {
+  // Sends a greeting
+  rpc SayHelloToCamel (CamelHelloRequest) returns (CamelHelloReply) {}
+}
+
+// The request message containing the user's name.
+message CamelHelloRequest {
+  string name = 1;
+}
+
+// The response message containing the greetings
+message CamelHelloReply {
+  string message = 1;
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/2c5c8b6d/examples/camel-example-grpc-kubernetes/pom.xml
----------------------------------------------------------------------
diff --git a/examples/camel-example-grpc-kubernetes/pom.xml b/examples/camel-example-grpc-kubernetes/pom.xml
new file mode 100644
index 0000000..c54fc35
--- /dev/null
+++ b/examples/camel-example-grpc-kubernetes/pom.xml
@@ -0,0 +1,45 @@
+<?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.example</groupId>
+    <artifactId>examples</artifactId>
+    <version>2.20.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>camel-example-grpc-kubernetes</artifactId>
+  <packaging>pom</packaging>
+  <name>Camel :: Example :: gRPC :: Kubernetes</name>
+  <description>An example showing the Camel gRPC component with Spring Boot running on Kubernetes</description>
+
+  <properties>
+    <category>Cloud</category>
+  </properties>
+
+  <modules>
+    <module>hello-camel-grpc-server-kubernetes</module>
+    <module>hello-camel-grpc-client-kubernetes</module>
+  </modules>
+
+</project>