Class GcpManagedChannelOptions.GcpResiliencyOptions.Builder
- Enclosing class:
- GcpManagedChannelOptions.GcpResiliencyOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Disable unresponsive connection detection.setNotReadyFallback(boolean enabled) If true, temporarily fallback requests to a ready channel from a channel which is not ready to send a request immediately.withUnresponsiveConnectionDetection(int ms, int numDroppedRequests) Enable unresponsive connection detection.
-
Constructor Details
-
Builder
public Builder() -
Builder
-
-
Method Details
-
build
-
setNotReadyFallback
If true, temporarily fallback requests to a ready channel from a channel which is not ready to send a request immediately. The fallback will happen if the pool has another channel in the READY state and that channel has less than maximum allowed concurrent active streams. -
withUnresponsiveConnectionDetection
public GcpManagedChannelOptions.GcpResiliencyOptions.Builder withUnresponsiveConnectionDetection(int ms, int numDroppedRequests) Enable unresponsive connection detection.If an RPC channel fails to receive any RPC message from the server for
msmilliseconds and there werenumDroppedRequestscalls (started after the last response from the server) that resulted in DEADLINE_EXCEEDED then a graceful reconnection of the channel will be performed.During the reconnection a new subchannel (connection) will be created for new RPCs, and the calls on the old subchannel will still have a chance to complete if the server side responds. When all RPCs on the old subchannel finish the old connection will be closed.
The
msshould not be less than the timeout used for the majority of calls. AndnumDroppedRequestsmust be > 0.The logic treats any message from the server almost as a "ping" response. But only calls started after the last response received and ended up in DEADLINE_EXCEEDED count towards
numDroppedRequests. Because of that, it may not detect an unresponsive connection if you have long-running streaming calls only. -
disableUnresponsiveConnectionDetection
public GcpManagedChannelOptions.GcpResiliencyOptions.Builder disableUnresponsiveConnectionDetection()Disable unresponsive connection detection.
-