Class ServerStreamingCallSettings<RequestT,ResponseT> (2.58.0)

public final class ServerStreamingCallSettings<RequestT,ResponseT> extends StreamingCallSettings<RequestT,ResponseT>

A settings class to configure a ServerStreamingCallable.

This class includes settings that are applicable to all server streaming calls, which currently just includes retries and watchdog timers.

The watchdog timer is configured via idleTimeout and waitTimeout. The watchdog will terminate any stream that has not has seen any demand (via StreamController#request(int)) in the configured interval or has not seen a message from the server in waitTimeout. To turn off idle checks, set the interval to java.time.Duration#ZERO.

Retry configuration allows for the stream to be restarted and resumed. It is composed of 3 parts: the retryable codes, the retry settings and the stream resumption strategy. The retryable codes indicate which codes cause a retry to occur, the retry settings configure the retry logic when the retry needs to happen, and the stream resumption strategy composes the request to resume the stream. To turn off retries, set the retryable codes to the empty set.

The retry settings have slightly different semantics when compared to unary RPCs:

  • retry delays are reset to the initial value as soon as a response is received.
  • RPC timeouts are reset to the initial value as soon as a response is received.
  • RPC timeouts apply to the time interval between caller demanding more responses via StreamController#request(int) and the ResponseObserver receiving the message.
  • RPC timeouts are best effort and are checked once every StubSettings#getStreamWatchdogCheckIntervalDuration().
  • Attempt counts are reset as soon as a response is received. This means that max attempts is the maximum number of failures in a row.
  • totalTimeout still applies to the entire stream.

Inheritance

java.lang.Object > StreamingCallSettings > ServerStreamingCallSettings<RequestT,ResponseT>

Type Parameters

Name Description
RequestT
ResponseT

Static Methods

<RequestT,ResponseT>newBuilder()

public static ServerStreamingCallSettings.Builder<RequestT,ResponseT> <RequestT,ResponseT>newBuilder()
Returns
Type Description
Builder<RequestT,ResponseT>

Methods

getIdleTimeout()

public Duration getIdleTimeout()

This method is obsolete. Use #getIdleTimeoutDuration() instead.

Returns
Type Description
org.threeten.bp.Duration

getIdleTimeoutDuration()

public Duration getIdleTimeoutDuration()

See the class documentation of ServerStreamingCallSettings for a description of what the #idleTimeout does.

Returns
Type Description
Duration

getResumptionStrategy()

public StreamResumptionStrategy<RequestT,ResponseT> getResumptionStrategy()

See the class documentation of ServerStreamingCallSettings and StreamResumptionStrategy for a description of what the StreamResumptionStrategy does.

Returns
Type Description
StreamResumptionStrategy<RequestT,ResponseT>

getRetrySettings()

public RetrySettings getRetrySettings()

See the class documentation of ServerStreamingCallSettings for a description of what retrySettings do.

Returns
Type Description
RetrySettings

getRetryableCodes()

public Set<StatusCode.Code> getRetryableCodes()

See the class documentation of ServerStreamingCallSettings for a description of what retryableCodes do.

Returns
Type Description
Set<Code>

getWaitTimeout()

public Duration getWaitTimeout()

This method is obsolete. Use #getWaitTimeoutDuration() instead.

Returns
Type Description
org.threeten.bp.Duration

getWaitTimeoutDuration()

public Duration getWaitTimeoutDuration()

See the class documentation of ServerStreamingCallSettings for a description of what the #waitTimeout does.

Returns
Type Description
Duration

toBuilder()

public ServerStreamingCallSettings.Builder<RequestT,ResponseT> toBuilder()
Returns
Type Description
Builder<RequestT,ResponseT>
Overrides

toString()

public String toString()
Returns
Type Description
String
Overrides