gRPC
JVM since1.0.0 Native since1.0.0
Expose gRPC endpoints and access external gRPC endpoints.
What’s inside
-
gRPC component, URI syntax:
grpc:host:port/service
Please refer to the above link for usage and configuration details.
Maven coordinates
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-grpc</artifactId>
</dependency>
Check the User guide for more information about writing Camel Quarkus applications.
Additional Camel Quarkus configuration
This extension leverages Quarkus gRPC. The configuration of the gRPC consumer is different than normal,
since Quarkus manages the lifecycle of the gRPC server. This means that the consumer endpoint host and port is driven by the configuration properties quarkus.grpc.server.host
and quarkus.grpc.server.port
and thus the Camel gRPC endpoint configuration for the host & port is effectively ignored. But, it’s still good practice to have the
endpoint configuration host / port mirror the Quarkus gRPC host / port property values to avoid confusion and ambiguity.
The full list of Quarkus gRPC configuration options can be found at the Quarkus gRPC guide.
Use the generate-code
goal of quarkus-maven-plugin
to generate Java classes from your *.proto
service and message definitions stored in the src/main/proto
directory:
<build>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>generate-code</goal>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
You may want to check the integration test in our source tree as an example.