Package org.apache.camel.component.grpc
Class GrpcConfiguration
java.lang.Object
org.apache.camel.component.grpc.GrpcConfiguration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAuthentication method type in advance to the SSL/TLS negotiationList
<io.grpc.ClientInterceptor> This option specifies the top-level strategy for processing service requests and responses in streaming mode.int
The HTTP/2 flow control window size (MiB)getHost()
The gRPC server host name.int
JSON Web Token sign algorithmJSON Web Token issuerJSON Web Token secretJSON Web Token subjectlong
long
The PKCS#8 private key file passwordint
long
long
long
int
int
int
int
gRPC method nameio.grpc.netty.NegotiationType
long
int
getPort()
The gRPC local or remote server portList
<io.grpc.ServerInterceptor> Fully qualified service name from the protocol buffer descriptor file (package dot service definition name)Service Account key file in JSON format resource link supported by the Google Cloud SDKThe user agent header passed to the serverboolean
boolean
boolean
boolean
boolean
boolean
boolean
Lets the route to take control over stream observer.boolean
boolean
void
void
setAuthenticationType
(GrpcAuthType authenticationType) void
setAutoDiscoverClientInterceptors
(boolean autoDiscoverClientInterceptors) Setting the autoDiscoverClientInterceptors mechanism, if true, the component will look for a ClientInterceptor instance in the registry automatically otherwise it will skip that checking.void
setAutoDiscoverServerInterceptors
(boolean autoDiscoverServerInterceptors) Setting the autoDiscoverServerInterceptors mechanism, if true, the component will look for a ServerInterceptor instance in the registry automatically otherwise it will skip that checking.void
setClientInterceptors
(List<io.grpc.ClientInterceptor> clientInterceptors) Setting the client interceptors on the netty channel in order to intercept outgoing calls before they are dispatched by the channel.void
setConsumerStrategy
(GrpcConsumerStrategy consumerStrategy) void
setFlowControlWindow
(int flowControlWindow) void
setForwardOnCompleted
(boolean forwardOnCompleted) Determines if onCompleted events should be pushed to the Camel route.void
setForwardOnError
(boolean forwardOnError) Determines if onError events should be pushed to the Camel route.void
void
setInheritExchangePropertiesForReplies
(boolean inheritExchangePropertiesForReplies) void
setInitialFlowControlWindow
(int initialFlowControlWindow) Sets the initial flow control window in bytes.void
setJwtAlgorithm
(JwtAlgorithm jwtAlgorithm) void
setJwtIssuer
(String jwtIssuer) void
setJwtSecret
(String jwtSecret) void
setJwtSubject
(String jwtSubject) void
setKeepAliveTime
(long keepAliveTime) Sets a custom keepalive time in milliseconds, the delay time for sending next keepalive ping.void
setKeepAliveTimeout
(long keepAliveTimeout) Sets a custom keepalive timeout in milliseconds, the timeout for keepalive ping requests.void
setKeyCertChainResource
(String keyCertChainResource) The X.509 certificate chain file resource in PEM format linkvoid
setKeyPassword
(String keyPassword) void
setKeyResource
(String keyResource) The PKCS#8 private key file resource in PEM format linkvoid
setMaxConcurrentCallsPerConnection
(int maxConcurrentCallsPerConnection) The maximum number of concurrent calls permitted for each incoming server connection.void
setMaxConnectionAge
(long maxConnectionAge) Sets a custom max connection age in milliseconds.void
setMaxConnectionAgeGrace
(long maxConnectionAgeGrace) Sets a custom grace time in milliseconds for the graceful connection termination.void
setMaxConnectionIdle
(long maxConnectionIdle) Sets a custom max connection idle time in milliseconds.void
setMaxInboundMetadataSize
(int maxInboundMetadataSize) Sets the maximum size of metadata allowed to be received.void
setMaxMessageSize
(int maxMessageSize) The maximum message size allowed to be received/sent (MiB)void
setMaxRstFramesPerWindow
(int maxRstFramesPerWindow) Limits the rate of incoming RST_STREAM frames per connection to maxRstFramesPerWindow per maxRstPeriodSeconds.void
setMaxRstPeriodSeconds
(int maxRstPeriodSeconds) Limits the rate of incoming RST_STREAM frames per maxRstPeriodSeconds.void
void
setNegotiationType
(io.grpc.netty.NegotiationType negotiationType) Identifies the security negotiation type used for HTTP/2 communicationvoid
setPermitKeepAliveTime
(long permitKeepAliveTime) Sets the most aggressive keep-alive time in milliseconds that clients are permitted to configure.void
setPermitKeepAliveWithoutCalls
(boolean permitKeepAliveWithoutCalls) Sets whether to allow clients to send keep-alive HTTP/ 2 PINGs even if there are no outstanding RPCs on the connection.void
setPort
(int port) void
setProducerStrategy
(GrpcProducerStrategy producerStrategy) The mode used to communicate with a remote gRPC server.void
setRouteControlledStreamObserver
(boolean routeControlledStreamObserver) void
setServerInterceptors
(List<io.grpc.ServerInterceptor> serverInterceptors) Setting the server interceptors on the netty channel in order to intercept incoming calls before they are received by the server.void
setService
(String service) void
setServiceAccountResource
(String serviceAccountResource) void
setStreamRepliesTo
(String streamRepliesTo) When using STREAMING client mode, it indicates the endpoint where responses should be forwarded.void
setSynchronous
(boolean synchronous) void
setToRouteControlledStreamObserver
(boolean toRouteControlledStreamObserver) void
setTrustCertCollectionResource
(String trustCertCollectionResource) The trusted certificates collection file resource in PEM format for verifying the remote endpoint's certificatevoid
setUserAgent
(String userAgent)
-
Constructor Details
-
GrpcConfiguration
public GrpcConfiguration()
-
-
Method Details
-
getService
Fully qualified service name from the protocol buffer descriptor file (package dot service definition name) -
setService
-
getMethod
gRPC method name -
setMethod
-
getHost
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. -
setHost
-
getPort
public int getPort()The gRPC local or remote server port -
setPort
public void setPort(int port) -
getNegotiationType
public io.grpc.netty.NegotiationType getNegotiationType() -
setNegotiationType
public void setNegotiationType(io.grpc.netty.NegotiationType negotiationType) Identifies the security negotiation type used for HTTP/2 communication -
getAuthenticationType
Authentication method type in advance to the SSL/TLS negotiation -
setAuthenticationType
-
getJwtAlgorithm
JSON Web Token sign algorithm -
setJwtAlgorithm
-
getJwtSecret
JSON Web Token secret -
setJwtSecret
-
getJwtIssuer
JSON Web Token issuer -
setJwtIssuer
-
getJwtSubject
JSON Web Token subject -
setJwtSubject
-
getServiceAccountResource
Service Account key file in JSON format resource link supported by the Google Cloud SDK -
setServiceAccountResource
-
getKeyCertChainResource
-
setKeyCertChainResource
The X.509 certificate chain file resource in PEM format link -
getKeyResource
-
setKeyResource
The PKCS#8 private key file resource in PEM format link -
getKeyPassword
The PKCS#8 private key file password -
setKeyPassword
-
getTrustCertCollectionResource
-
setTrustCertCollectionResource
The trusted certificates collection file resource in PEM format for verifying the remote endpoint's certificate -
getConsumerStrategy
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. -
setConsumerStrategy
-
isForwardOnCompleted
public boolean isForwardOnCompleted() -
setForwardOnCompleted
public void setForwardOnCompleted(boolean forwardOnCompleted) Determines if onCompleted events should be pushed to the Camel route. -
isForwardOnError
public boolean isForwardOnError() -
setForwardOnError
public void setForwardOnError(boolean forwardOnError) Determines if onError events should be pushed to the Camel route. Exceptions will be set as message body. -
getProducerStrategy
-
setProducerStrategy
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'). -
getStreamRepliesTo
-
setStreamRepliesTo
When using STREAMING client mode, it indicates the endpoint where responses should be forwarded. -
getUserAgent
The user agent header passed to the server -
setUserAgent
-
getFlowControlWindow
public int getFlowControlWindow()The HTTP/2 flow control window size (MiB) -
setFlowControlWindow
public void setFlowControlWindow(int flowControlWindow) -
getMaxMessageSize
public int getMaxMessageSize() -
setMaxMessageSize
public void setMaxMessageSize(int maxMessageSize) The maximum message size allowed to be received/sent (MiB) -
isRouteControlledStreamObserver
public boolean isRouteControlledStreamObserver()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 nameinvalid reference
GrpcConstants.GRPC_RESPONSE_OBSERVER
Please note that the stream observer's onNext(), onError(), onCompleted() methods should be called in the route.
-
setRouteControlledStreamObserver
public void setRouteControlledStreamObserver(boolean routeControlledStreamObserver) -
getMaxConcurrentCallsPerConnection
public int getMaxConcurrentCallsPerConnection() -
setMaxConcurrentCallsPerConnection
public void setMaxConcurrentCallsPerConnection(int maxConcurrentCallsPerConnection) The maximum number of concurrent calls permitted for each incoming server connection. Defaults to no limit. -
getServerInterceptors
-
setServerInterceptors
Setting the server interceptors on the netty channel in order to intercept incoming calls before they are received by the server. -
isAutoDiscoverServerInterceptors
public boolean isAutoDiscoverServerInterceptors() -
setAutoDiscoverServerInterceptors
public void setAutoDiscoverServerInterceptors(boolean autoDiscoverServerInterceptors) Setting the autoDiscoverServerInterceptors mechanism, if true, the component will look for a ServerInterceptor instance in the registry automatically otherwise it will skip that checking. -
getClientInterceptors
-
setClientInterceptors
Setting the client interceptors on the netty channel in order to intercept outgoing calls before they are dispatched by the channel. -
isAutoDiscoverClientInterceptors
public boolean isAutoDiscoverClientInterceptors() -
setAutoDiscoverClientInterceptors
public void setAutoDiscoverClientInterceptors(boolean autoDiscoverClientInterceptors) Setting the autoDiscoverClientInterceptors mechanism, if true, the component will look for a ClientInterceptor instance in the registry automatically otherwise it will skip that checking. -
isSynchronous
public boolean isSynchronous() -
setSynchronous
public void setSynchronous(boolean synchronous) -
isInheritExchangePropertiesForReplies
public boolean isInheritExchangePropertiesForReplies() -
setInheritExchangePropertiesForReplies
public void setInheritExchangePropertiesForReplies(boolean inheritExchangePropertiesForReplies) -
isToRouteControlledStreamObserver
public boolean isToRouteControlledStreamObserver() -
setToRouteControlledStreamObserver
public void setToRouteControlledStreamObserver(boolean toRouteControlledStreamObserver) -
getInitialFlowControlWindow
public int getInitialFlowControlWindow() -
setInitialFlowControlWindow
public void setInitialFlowControlWindow(int initialFlowControlWindow) Sets the initial flow control window in bytes. -
getKeepAliveTime
public long getKeepAliveTime() -
setKeepAliveTime
public void setKeepAliveTime(long keepAliveTime) 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. -
getKeepAliveTimeout
public long getKeepAliveTimeout() -
setKeepAliveTimeout
public void setKeepAliveTimeout(long keepAliveTimeout) Sets a custom keepalive timeout in milliseconds, the timeout for keepalive ping requests. -
getMaxConnectionAge
public long getMaxConnectionAge() -
setMaxConnectionAge
public void setMaxConnectionAge(long maxConnectionAge) 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. -
getMaxConnectionIdle
public long getMaxConnectionIdle() -
setMaxConnectionIdle
public void setMaxConnectionIdle(long maxConnectionIdle) 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 -
getMaxConnectionAgeGrace
public long getMaxConnectionAgeGrace() -
setMaxConnectionAgeGrace
public void setMaxConnectionAgeGrace(long maxConnectionAgeGrace) 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. -
getMaxInboundMetadataSize
public int getMaxInboundMetadataSize() -
setMaxInboundMetadataSize
public void setMaxInboundMetadataSize(int maxInboundMetadataSize) Sets the maximum size of metadata allowed to be received. The default is 8 KiB. -
getMaxRstFramesPerWindow
public int getMaxRstFramesPerWindow() -
setMaxRstFramesPerWindow
public void setMaxRstFramesPerWindow(int maxRstFramesPerWindow) 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. -
getMaxRstPeriodSeconds
public int getMaxRstPeriodSeconds() -
setMaxRstPeriodSeconds
public void setMaxRstPeriodSeconds(int maxRstPeriodSeconds) Limits the rate of incoming RST_STREAM frames per maxRstPeriodSeconds. This option MUST be used in conjunction with maxRstFramesPerWindow for it to be effective. -
getPermitKeepAliveTime
public long getPermitKeepAliveTime() -
setPermitKeepAliveTime
public void setPermitKeepAliveTime(long permitKeepAliveTime) 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. -
isPermitKeepAliveWithoutCalls
public boolean isPermitKeepAliveWithoutCalls() -
setPermitKeepAliveWithoutCalls
public void setPermitKeepAliveWithoutCalls(boolean permitKeepAliveWithoutCalls) Sets whether to allow clients to send keep-alive HTTP/ 2 PINGs even if there are no outstanding RPCs on the connection. -
parseURI
-