# Cloud Pub/Sub v1 API - Class SubscriberClient.Settings (3.36.0)

3.36.0 (latest) 3.35.0 3.34.0 3.33.0 3.32.0 3.31.0 3.30.0 3.29.0 3.28.0 3.27.0 3.26.0 3.25.0 3.24.0 3.23.0 3.22.0 3.21.0 3.20.0 3.19.0 3.18.0 3.17.0 3.16.0 3.15.0 3.14.0 3.13.0 3.12.0 3.11.0 3.10.1 3.9.1 3.8.0 3.7.0 3.6.0 3.5.1 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0

    public sealed class SubscriberClient.Settings

Reference documentation and code samples for the Cloud Pub/Sub v1 API class SubscriberClient.Settings.

Settings for [SubscriberClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClient).
Defaults will be used for `null` properties.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> SubscriberClient.Settings

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.PubSub.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1)

## Assembly

Google.Cloud.PubSub.V1.dll

## Constructors

### Settings()

    public Settings()

Create a new instance.

## Properties

### AckDeadline

    public TimeSpan? AckDeadline { get; set; }

The lease time before which a message must either be acknowledged
or have its lease extended. This is truncated to the nearest second.
If `null`, uses the default of [DefaultAckDeadline](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClient#Google_Cloud_PubSub_V1_SubscriberClient_DefaultAckDeadline).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.timespan` |   |

### AckExtensionWindow

    public TimeSpan? AckExtensionWindow { get; set; }

Duration before [AckDeadline](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClient.Settings#Google_Cloud_PubSub_V1_SubscriberClient_Settings_AckDeadline) at which the message acknowledgement deadline
is automatically extended.
If `null`, uses the default of [DefaultAckExtensionWindow](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClient#Google_Cloud_PubSub_V1_SubscriberClient_DefaultAckExtensionWindow).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.timespan` |   |

### Clock

    public IClock Clock { get; set; }

The [IClock](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IClock.html) used for timeouts and retries.
If `null`, the default [SystemClock](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.SystemClock.html) is used.
This is usually only used for testing.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IClock.html` |   |

**Remarks** This is used only in exactly once delivery flow as we need to retry temporary failures.

### DisposeTimeout

    public TimeSpan? DisposeTimeout { get; set; }

Represents a time interval to wait for the [SubscriberClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClient) to acknowledge the handled messages
after the [DisposeAsync()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClient#Google_Cloud_PubSub_V1_SubscriberClient_DisposeAsync) method has been called. If this time interval expires, the clean stop
process will be aborted, and some handled messages may remain un-acknowledged.
If `null`, defaults to [DefaultDisposeTimeout](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClient#Google_Cloud_PubSub_V1_SubscriberClient_DefaultDisposeTimeout).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.timespan` |   |

### FlowControlSettings

    public FlowControlSettings FlowControlSettings { get; set; }

Flow control settings.
If `null`, uses flow control settings from [DefaultFlowControlSettings](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClient#Google_Cloud_PubSub_V1_SubscriberClient_DefaultFlowControlSettings).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.FlowControlSettings.html` |   |

**Remarks**
Flow control uses these settings for two purposes: fetching messages to process, and processing them.


In terms of fetching messages, a single [SubscriberClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClient) creates multiple instances of
[SubscriberServiceApiClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberServiceApiClient), and each will observe the flow control settings independently.
This means there may be more outstanding messages (or bytes) than expected; there is currently no way
of limiting the total number or size of outstanding messages fetched across all data streams for a single
[SubscriberClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClient).


Separately, the number of messages being processed concurrently is limited by these settings, at
the level of the whole [SubscriberClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClient).


For example, if [MaxOutstandingElementCount](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.FlowControlSettings.html#Google_Api_Gax_FlowControlSettings_MaxOutstandingElementCount) is set to 10, then a single
[SubscriberClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClient) using 4 instances of [SubscriberServiceApiClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberServiceApiClient) will have up
to 40 outstanding messages to process, but will only process at most 10 of them concurrently.

### MaxTotalAckExtension

    public TimeSpan? MaxTotalAckExtension { get; set; }

Maximum duration for which a message acknowledgement deadline will be extended.
If `null`, uses the default of [DefaultMaxTotalAckExtension](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClient#Google_Cloud_PubSub_V1_SubscriberClient_DefaultMaxTotalAckExtension).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.timespan` |   |

### Scheduler

    public IScheduler Scheduler { get; set; }

The [IScheduler](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IScheduler.html) used to schedule delays.
If `null`, the default [SystemScheduler](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.SystemScheduler.html) is used.
This is usually only used for testing.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IScheduler.html` |   |

### UseLegacyFlowControl

    public bool UseLegacyFlowControl { get; set; }

If set to true, disables enforcing flow control settings at the Cloud PubSub server
and uses the less accurate method of only enforcing flow control at the client side.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

## Methods

### Clone()

    public SubscriberClient.Settings Clone()

Create a clone of this object.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClienthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PubSub.V1/latest/Google.Cloud.PubSub.V1.SubscriberClient.Settings` | A clone of this object. |