2 Home
gitea_admin edited this page 2026-03-11 14:38:35 +00:00

gRPC

Expose gRPC endpoints and access external gRPC endpoints.

Metadata

Property Value
Scheme grpc
Support Level Stable
Labels rpc
Version 4.10.2

Maven Dependency

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-grpc</artifactId>
    <version>4.10.2</version>
</dependency>

Endpoint Properties

Name Type Required Default Description
host string The gRPC server host name. This is localhost or 0.0.0.0 when being a consumer or remote server host name when using producer.
port integer The gRPC local or remote server port
service string Fully qualified service name from the protocol buffer descriptor file (package dot service definition name)
flowControlWindow integer 1048576 The HTTP/2 flow control window size (MiB)
maxMessageSize integer 4194304 The maximum message size allowed to be received/sent (MiB)
autoDiscoverServerInterceptors boolean true Setting the autoDiscoverServerInterceptors mechanism, if true, the component will look for a ServerInterceptor instance in the registry automatically otherwise it will skip that checking.
consumerStrategy object PROPAGATION This option specifies the top-level strategy for processing service requests and responses in streaming mode. If an aggregation strategy is selected, all requests will be accumulated in the list, then transferred to the flow, and the accumulated responses will be sent to the sender. If a propagation strategy is selected, request is sent to the stream, and the response will be immediately sent back to the sender. If a delegation strategy is selected, request is sent to the stream, but no response generated under the assumption that all necessary responses will be sent at another part of route. Delegation strategy always comes with routeControlledStreamObserver=true to be able to achieve the assumption.
forwardOnCompleted boolean false Determines if onCompleted events should be pushed to the Camel route.
forwardOnError boolean false Determines if onError events should be pushed to the Camel route. Exceptions will be set as message body.
initialFlowControlWindow integer 1048576 Sets the initial flow control window in bytes.
keepAliveTime integer 7200000 Sets a custom keepalive time in milliseconds, the delay time for sending next keepalive ping. A value of Long.MAX_VALUE or a value greater or equal to NettyServerBuilder.AS_LARGE_AS_INFINITE will disable keepalive.
keepAliveTimeout integer 20000 Sets a custom keepalive timeout in milliseconds, the timeout for keepalive ping requests.
maxConcurrentCallsPerConnection integer 2147483647 The maximum number of concurrent calls permitted for each incoming server connection. Defaults to no limit.
maxConnectionAge integer 9223372036854776000 Sets a custom max connection age in milliseconds. Connections lasting longer than which will be gracefully terminated. A random jitter of /-10% will be added to the value. A value of Long.MAX_VALUE (the default) or a value greater or equal to NettyServerBuilder.AS_LARGE_AS_INFINITE will disable max connection age.
maxConnectionAgeGrace integer 9223372036854776000 Sets a custom grace time in milliseconds for the graceful connection termination. A value of Long.MAX_VALUE (the default) or a value greater or equal to NettyServerBuilder.AS_LARGE_AS_INFINITE is considered infinite.
maxConnectionIdle integer 9223372036854776000 Sets a custom max connection idle time in milliseconds. Connection being idle for longer than which will be gracefully terminated. A value of Long.MAX_VALUE (the default) or a value greater or equal to NettyServerBuilder.AS_LARGE_AS_INFINITE will disable max connection idle
maxInboundMetadataSize integer 8192 Sets the maximum size of metadata allowed to be received. The default is 8 KiB.
maxRstFramesPerWindow integer 0 Limits the rate of incoming RST_STREAM frames per connection to maxRstFramesPerWindow per maxRstPeriodSeconds. This option MUST be used in conjunction with maxRstPeriodSeconds for it to be effective.
maxRstPeriodSeconds integer 0 Limits the rate of incoming RST_STREAM frames per maxRstPeriodSeconds. This option MUST be used in conjunction with maxRstFramesPerWindow for it to be effective.
permitKeepAliveTime integer 300000 Sets the most aggressive keep-alive time in milliseconds that clients are permitted to configure. The server will try to detect clients exceeding this rate and will forcefully close the connection.
permitKeepAliveWithoutCalls boolean false Sets whether to allow clients to send keep-alive HTTP/ 2 PINGs even if there are no outstanding RPCs on the connection.
routeControlledStreamObserver boolean false Lets the route to take control over stream observer. If this value is set to true, then the response observer of gRPC call will be set with the name GrpcConstants.GRPC_RESPONSE_OBSERVER in the Exchange object. Please note that the stream observer's onNext(), onError(), onCompleted() methods should be called in the route.
bridgeErrorHandler boolean false Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.
exceptionHandler object To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.
exchangePattern object Sets the exchange pattern when the consumer creates an exchange.
autoDiscoverClientInterceptors boolean true Setting the autoDiscoverClientInterceptors mechanism, if true, the component will look for a ClientInterceptor instance in the registry automatically otherwise it will skip that checking.
inheritExchangePropertiesForReplies boolean false Copies exchange properties from original exchange to all exchanges created for route defined by streamRepliesTo.
method string gRPC method name
producerStrategy object SIMPLE The mode used to communicate with a remote gRPC server. In SIMPLE mode a single exchange is translated into a remote procedure call. In STREAMING mode all exchanges will be sent within the same request (input and output of the recipient gRPC service must be of type 'stream').
streamRepliesTo string When using STREAMING client mode, it indicates the endpoint where responses should be forwarded.
toRouteControlledStreamObserver boolean false Expects that exchange property GrpcConstants.GRPC_RESPONSE_OBSERVER is set. Takes its value and calls onNext, onError and onComplete on that StreamObserver. All other gRPC parameters are ignored.
userAgent string The user agent header passed to the server
lazyStartProducer boolean false Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.
synchronous boolean false Sets whether synchronous processing should be strictly used
authenticationType object NONE Authentication method type in advance to the SSL/TLS negotiation
jwtAlgorithm object HMAC256 JSON Web Token sign algorithm
jwtIssuer string JSON Web Token issuer
jwtSecret string JSON Web Token secret
jwtSubject string JSON Web Token subject
keyCertChainResource string The X.509 certificate chain file resource in PEM format link
keyPassword string The PKCS#8 private key file password
keyResource string The PKCS#8 private key file resource in PEM format link
negotiationType object PLAINTEXT Identifies the security negotiation type used for HTTP/2 communication
serviceAccountResource string Service Account key file in JSON format resource link supported by the Google Cloud SDK
trustCertCollectionResource string The trusted certificates collection file resource in PEM format for verifying the remote endpoint's certificate