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

public sealed class SubscriberClient.Settings

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

Settings for SubscriberClient. Defaults will be used for null properties.

Inheritance

object > SubscriberClient.Settings

Namespace

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.

Property Value
TypeDescription
TimeSpan

AckExtensionWindow

public TimeSpan? AckExtensionWindow { get; set; }

Duration before AckDeadline at which the message acknowledgement deadline is automatically extended. If null, uses the default of DefaultAckExtensionWindow.

Property Value
TypeDescription
TimeSpan

Clock

public IClock Clock { get; set; }

The IClock used for timeouts and retries. If null, the default SystemClock is used. This is usually only used for testing.

Property Value
TypeDescription
IClock
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 to acknowledge the handled messages after the 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.

Property Value
TypeDescription
TimeSpan

FlowControlSettings

public FlowControlSettings FlowControlSettings { get; set; }

Flow control settings. If null, uses flow control settings from DefaultFlowControlSettings.

Property Value
TypeDescription
FlowControlSettings
Remarks

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

In terms of fetching messages, a single SubscriberClient creates multiple instances of 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.

Separately, the number of messages being processed concurrently is limited by these settings, at the level of the whole SubscriberClient.

For example, if MaxOutstandingElementCount is set to 10, then a single SubscriberClient using 4 instances of 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.

Property Value
TypeDescription
TimeSpan

Scheduler

public IScheduler Scheduler { get; set; }

The IScheduler used to schedule delays. If null, the default SystemScheduler is used. This is usually only used for testing.

Property Value
TypeDescription
IScheduler

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
TypeDescription
bool

Methods

Clone()

public SubscriberClient.Settings Clone()

Create a clone of this object.

Returns
TypeDescription
SubscriberClientSettings

A clone of this object.