CAMEL-11107: Changing camel-grpc documentation
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/bd317a8a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bd317a8a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bd317a8a Branch: refs/heads/master Commit: bd317a8a9e3b69241f99c7b2d95b561e7218e68c Parents: 45b17fc Author: Dmitry Volodin <dmvo...@gmail.com> Authored: Wed Apr 5 12:38:37 2017 +0300 Committer: Andrea Cosentino <anco...@gmail.com> Committed: Fri Apr 7 13:45:45 2017 +0200 ---------------------------------------------------------------------- .../src/main/docs/grpc-component.adoc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/bd317a8a/components/camel-grpc/src/main/docs/grpc-component.adoc ---------------------------------------------------------------------- diff --git a/components/camel-grpc/src/main/docs/grpc-component.adoc b/components/camel-grpc/src/main/docs/grpc-component.adoc index 417387e..3f06f14 100644 --- a/components/camel-grpc/src/main/docs/grpc-component.adoc +++ b/components/camel-grpc/src/main/docs/grpc-component.adoc @@ -3,8 +3,8 @@ *Available as of Camel version 2.19* The gRPC component allows you to do Remote Procedure Call (RPC) -using https://developers.google.com/protocol-buffers/docs/overview[Protocol Buffers (protobuf)] format -over HTTP/2 transport. +using https://developers.google.com/protocol-buffers/docs/overview[Protocol Buffers (protobuf)] +exchange format over HTTP/2 transport. Maven users will need to add the following dependency to their `pom.xml` for this component: @@ -72,23 +72,23 @@ Below is a simple synchronous method invoke with host and port parameters [source,java] ------------------------------------------------------------------------------- from("direct:grpc-sync") -.to("grpc://org.apache.camel.component.grpc.PingPong?method=sendPing&host=localhost&port=1000"); +.to("grpc://org.apache.camel.component.grpc.PingPong?method=sendPing&host=localhost&port=1000&synchronous=true"); ------------------------------------------------------------------------------- [source,java] --------------------------------------------------------------------------------------- <route> - <from uri="direct:grpc-async" /> - <to uri="grpc://org.apache.camel.component.grpc.PingPong?method=pingAsyncResponse&host=localhost&port=1000"/> + <from uri="direct:grpc-sync" /> + <to uri="grpc://org.apache.camel.component.grpc.PingPong?method=sendPing&host=localhost&port=1000&synchronous=true"/> </route> --------------------------------------------------------------------------------------- -A asynchronous method invoke with target host and port parameter +An asynchronous method invoke with target host and port parameter [source,java] ------------------------------------------------------------------------------- from("direct:index") -.to("grpc://org.apache.camel.component.grpc.PingPong?method=sendPing&invoke=ASYNC&target=dns:///hostname:8000"); +.to("grpc://org.apache.camel.component.grpc.PingPong?method=pingAsyncResponse&target=dns:///hostname:8000"); ------------------------------------------------------------------------------- It's it is recommended to use Maven Protocol Buffers Plugin which calls Protocol Buffer Compiler (protoc) tool to generate Java source files from .proto (protocol buffer definition) files for the custom project. This plugin will generate procedures request and response classes, their builders and gRPC procedures stubs classes as well. @@ -124,6 +124,8 @@ Insert gRPC and protobuf Java code generator plugin **<plugins>** tag of the pro <goals> <goal>compile</goal> <goal>compile-custom</goal> + <goal>test-compile</goal> + <goal>test-compile-custom</goal> </goals> </execution> </executions> @@ -138,7 +140,9 @@ https://www.xolstice.org/protobuf-maven-plugin[Maven Protocol Buffers Plugin] ### See Also +* link:getting-started.html[Getting Started] * link:configuring-camel.html[Configuring Camel] * link:component.html[Component] * link:endpoint.html[Endpoint] -* link:getting-started.html[Getting Started] +* link:protobuf.html[Protocol Buffers Data Format] +