# Class ServerStreamingCallSettings&lt;RequestT,ResponseT&gt; (2.81.0)

2.81.0 (latest) 2.80.0 2.79.0 2.76.0 2.75.0 2.74.1 2.73.1 2.72.2 2.71.0 2.70.3 2.69.0 2.68.2 2.67.0 2.66.0 2.65.0 2.63.1 2.62.0 2.61.0 2.60.0 2.59.1 2.58.0 2.57.0 2.55.0 2.54.1 2.53.0 2.52.0 2.51.0 2.50.0 2.49.0 2.48.1 2.47.0 2.46.1 2.45.0 2.43.0 2.42.0 2.41.0 2.39.0 2.38.0 2.37.0 2.36.0 2.35.0 2.34.1 2.33.0 2.32.1 2.31.1 2.30.1 2.24.0 2.23.3 2.22.0 2.21.0 2.20.1 2.19.6 2.18.7 2.17.0 2.16.0 2.15.0 2.14.0 2.13.0 2.12.2 2.11.0 2.10.0 2.9.0 2.8.1 2.7.1

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

A settings class to configure a [ServerStreamingCallable](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.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)](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.StreamController#com_google_api_gax_rpc_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)](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.StreamController#com_google_api_gax_rpc_StreamController_request_int_) and the [ResponseObserver](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ResponseObserver) receiving the message.
- RPC timeouts are best effort and are checked once every [StubSettings#getStreamWatchdogCheckIntervalDuration()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.StubSettings#com_google_api_gax_rpc_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](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [StreamingCallSettings](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.StreamingCallSettings) \> ServerStreamingCallSettings\<RequestT,ResponseT\>

## Inherited Members

[StreamingCallSettings.\<RequestT,ResponseT\>newBuilder()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.StreamingCallSettings#com_google_api_gax_rpc_StreamingCallSettings__RequestT_ResponseT_newBuilder__) [StreamingCallSettings.toBuilder()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.StreamingCallSettings#com_google_api_gax_rpc_StreamingCallSettings_toBuilder__) [Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

| ## Type Parameters ||
|---|---|
| **Name** | **Description** |
| `RequestT` |   |
| `ResponseT` |   |

## Static Methods

### \<RequestT,ResponseT\>newBuilder()

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ServerStreamingCallSettings.Builder<RequestT,ResponseT>` |   |

## Methods

### getIdleTimeout()

    public Duration getIdleTimeout()

> [!WARNING]
> **Obsolete**
>
> *Use getIdleTimeoutDuration() instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

This method is obsolete. Use [#getIdleTimeoutDuration()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ServerStreamingCallSettings#com_google_api_gax_rpc_ServerStreamingCallSettings_getIdleTimeoutDuration__) instead.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `org.threeten.bp.Duration` |   |

### getIdleTimeoutDuration()

    public Duration getIdleTimeoutDuration()

See the class documentation of [ServerStreamingCallSettings](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ServerStreamingCallSettings) for a description of what
the #idleTimeout does.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` |   |

### getResumptionStrategy()

    public StreamResumptionStrategy<RequestT,ResponseT> getResumptionStrategy()

See the class documentation of [ServerStreamingCallSettings](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ServerStreamingCallSettings) and [StreamResumptionStrategy](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.StreamResumptionStrategy) for a description of what the StreamResumptionStrategy does.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.StreamResumptionStrategy<RequestT,ResponseT>` |   |

### getRetrySettings()

    public RetrySettings getRetrySettings()

See the class documentation of [ServerStreamingCallSettings](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ServerStreamingCallSettings) for a description of what
retrySettings do.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings` |   |

### getRetryableCodes()

    public Set<StatusCode.Code> getRetryableCodes()

See the class documentation of [ServerStreamingCallSettings](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ServerStreamingCallSettings) for a description of what
retryableCodes do.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Set.html<https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.StatusCode.Code>` |   |

### getWaitTimeout()

    public Duration getWaitTimeout()

> [!WARNING]
> **Obsolete**
>
> *Use getWaitTimeoutDuration() instead*
>
> This feature is stable for usage in this major version, but may be deprecated in a future release.

This method is obsolete. Use [#getWaitTimeoutDuration()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ServerStreamingCallSettings#com_google_api_gax_rpc_ServerStreamingCallSettings_getWaitTimeoutDuration__) instead.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `org.threeten.bp.Duration` |   |

### getWaitTimeoutDuration()

    public Duration getWaitTimeoutDuration()

See the class documentation of [ServerStreamingCallSettings](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ServerStreamingCallSettings) for a description of what
the #waitTimeout does.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` |   |

### toBuilder()

    public ServerStreamingCallSettings.Builder<RequestT,ResponseT> toBuilder()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.ServerStreamingCallSettings.Builder<RequestT,ResponseT>` |   |

**Overrides** [StreamingCallSettings\<RequestT,ResponseT\>.toBuilder()](https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.StreamingCallSettings#com_google_api_gax_rpc_StreamingCallSettings_toBuilder__)

### toString()

    public String toString()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

**Overrides** [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)