Class SubscriberClientBuilder (3.1.0)

public sealed class SubscriberClientBuilder : ClientBuilderBase<SubscriberClient>

Builder class for SubscriberClient to provide simple configuration of credentials, endpoint, client count, subscription settings etc.

Inheritance

Object > ClientBuilderBase<SubscriberClient> > SubscriberClientBuilder

Namespace

Google.Cloud.PubSub.V1

Assembly

Google.Cloud.PubSub.V1.dll

Constructors

SubscriberClientBuilder()

public SubscriberClientBuilder()

Creates a new instance with default settings. TopicName must be set before calling either Build() or BuildAsync(CancellationToken).

Properties

ApiSettings

public SubscriberServiceApiSettings ApiSettings { get; set; }

The settings to use when creatingSubscriberServiceApiClient instances. Default settings will be used if this is null.

Property Value
TypeDescription
SubscriberServiceApiSettings

ClientCount

public int? ClientCount { get; set; }

The number of SubscriberServiceApiClients to create and use within a SubscriberClient instance. If this is null, the number of clients created will depend on the processor count.

Property Value
TypeDescription
Nullable<Int32>

EmulatorDetection

public EmulatorDetection EmulatorDetection { get; set; }

Specifies how to respond to the presence of emulator environment variables.

Property Value
TypeDescription
EmulatorDetection
Remarks

This property defaults to None, meaning that environment variables are ignored.

Settings

public SubscriberClient.Settings Settings { get; set; }

Additional settings for batching, message ordering etc. Default settings will be used if this is null.

Property Value
TypeDescription
SubscriberClient.Settings

SubscriptionName

public SubscriptionName SubscriptionName { get; set; }

The name of the subscription that the subscriber subscribes to. This must be non-null by the time Build() or BuildAsync(CancellationToken) is called.

Property Value
TypeDescription
SubscriptionName

Methods

Build()

public override SubscriberClient Build()

Builds the resulting client.

Returns
TypeDescription
SubscriberClient
Overrides
Google.Api.Gax.Grpc.ClientBuilderBase<Google.Cloud.PubSub.V1.SubscriberClient>.Build()

BuildAsync(CancellationToken)

public override Task<SubscriberClient> BuildAsync(CancellationToken cancellationToken = default(CancellationToken))

Builds the resulting client asynchronously.

Parameter
NameDescription
cancellationTokenCancellationToken
Returns
TypeDescription
Task<SubscriberClient>
Overrides
Google.Api.Gax.Grpc.ClientBuilderBase<Google.Cloud.PubSub.V1.SubscriberClient>.BuildAsync(System.Threading.CancellationToken)

GetChannelPool()

protected override ChannelPool GetChannelPool()
Returns
TypeDescription
ChannelPool
Overrides
Google.Api.Gax.Grpc.ClientBuilderBase<Google.Cloud.PubSub.V1.SubscriberClient>.GetChannelPool()

Validate()

protected override void Validate()
Overrides
Google.Api.Gax.Grpc.ClientBuilderBase<Google.Cloud.PubSub.V1.SubscriberClient>.Validate()