Class GcpManagedChannelOptions.GcpResiliencyOptions.Builder (1.11.0)

public static class GcpManagedChannelOptions.GcpResiliencyOptions.Builder

Inheritance

java.lang.Object > GcpManagedChannelOptions.GcpResiliencyOptions.Builder

Constructors

Builder()

public Builder()

Builder(GcpManagedChannelOptions.GcpResiliencyOptions options)

public Builder(GcpManagedChannelOptions.GcpResiliencyOptions options)
Parameter
Name Description
options GcpManagedChannelOptions.GcpResiliencyOptions

Methods

build()

public GcpManagedChannelOptions.GcpResiliencyOptions build()
Returns
Type Description
GcpManagedChannelOptions.GcpResiliencyOptions

disableUnresponsiveConnectionDetection()

public GcpManagedChannelOptions.GcpResiliencyOptions.Builder disableUnresponsiveConnectionDetection()

Disable unresponsive connection detection.

Returns
Type Description
GcpManagedChannelOptions.GcpResiliencyOptions.Builder

setNotReadyFallback(boolean enabled)

public GcpManagedChannelOptions.GcpResiliencyOptions.Builder setNotReadyFallback(boolean enabled)

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.

Parameter
Name Description
enabled boolean
Returns
Type Description
GcpManagedChannelOptions.GcpResiliencyOptions.Builder

withUnresponsiveConnectionDetection(int ms, int numDroppedRequests)

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 ms milliseconds and there were numDroppedRequests calls (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 ms should not be less than the timeout used for the majority of calls. And numDroppedRequests must 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.

Parameters
Name Description
ms int
numDroppedRequests int
Returns
Type Description
GcpManagedChannelOptions.GcpResiliencyOptions.Builder