Class SubscriberSettings.Builder (1.7.1)

public abstract static class SubscriberSettings.Builder

Inheritance

java.lang.Object > SubscriberSettings.Builder

Constructors

Builder()

public Builder()

Methods

build()

public abstract SubscriberSettings build()
Returns
TypeDescription
SubscriberSettings

setAssignmentServiceClient(PartitionAssignmentServiceClient client)

public abstract SubscriberSettings.Builder setAssignmentServiceClient(PartitionAssignmentServiceClient client)

A client to connect to the Pub/Sub lite assignment service. If present, ignores CredentialsProvider.

Parameter
NameDescription
clientPartitionAssignmentServiceClient
Returns
TypeDescription
SubscriberSettings.Builder

setCredentialsProvider(CredentialsProvider provider)

public abstract SubscriberSettings.Builder setCredentialsProvider(CredentialsProvider provider)

A provider for credentials.

Parameter
NameDescription
providerCredentialsProvider
Returns
TypeDescription
SubscriberSettings.Builder

setCursorServiceClient(CursorServiceClient client)

public abstract SubscriberSettings.Builder setCursorServiceClient(CursorServiceClient client)

A CursorServiceClient to use, if present.

Parameter
NameDescription
clientCursorServiceClient
Returns
TypeDescription
SubscriberSettings.Builder

setFramework(PubsubContext.Framework framework)

public abstract SubscriberSettings.Builder setFramework(PubsubContext.Framework framework)

A Framework tag for internal metrics. Please set this if integrating with a public framework!

Parameter
NameDescription
frameworkPubsubContext.Framework
Returns
TypeDescription
SubscriberSettings.Builder

setNackHandler(NackHandler nackHandler)

public abstract SubscriberSettings.Builder setNackHandler(NackHandler nackHandler)

A handler for the action to take when com.google.cloud.pubsub.v1.AckReplyConsumer#nack is called. In Pub/Sub Lite, only a single subscriber for a given subscription is connected to any partition at a time, and there is no other client that may be able to handle messages.

Parameter
NameDescription
nackHandlerNackHandler
Returns
TypeDescription
SubscriberSettings.Builder

setPartitions(List<Partition> partition)

public abstract SubscriberSettings.Builder setPartitions(List<Partition> partition)

The partitions this subscriber should connect to to receive messages. If set, disables auto-assignment.

Parameter
NameDescription
partitionList<Partition>
Returns
TypeDescription
SubscriberSettings.Builder

setPerPartitionFlowControlSettings(FlowControlSettings settings)

public abstract SubscriberSettings.Builder setPerPartitionFlowControlSettings(FlowControlSettings settings)

The per-partition flow control settings. Because these apply per-partition, if you are using them to bound memory usage, keep in mind the number of partitions in the associated topic.

Parameter
NameDescription
settingsFlowControlSettings
Returns
TypeDescription
SubscriberSettings.Builder

setReassignmentHandler(ReassignmentHandler reassignmentHandler)

public abstract SubscriberSettings.Builder setReassignmentHandler(ReassignmentHandler reassignmentHandler)

A handler that will be notified when partition assignments change from the backend.

Parameter
NameDescription
reassignmentHandlerReassignmentHandler
Returns
TypeDescription
SubscriberSettings.Builder

setReceiver(MessageReceiver receiver)

public abstract SubscriberSettings.Builder setReceiver(MessageReceiver receiver)

The receiver which handles new messages sent by the Pub/Sub Lite system. Only one downcall from any connected partition will be outstanding at a time, and blocking in this receiver callback will block forward progress.

Parameter
NameDescription
receivercom.google.cloud.pubsub.v1.MessageReceiver
Returns
TypeDescription
SubscriberSettings.Builder

setSubscriberServiceClient(SubscriberServiceClient client)

public abstract SubscriberSettings.Builder setSubscriberServiceClient(SubscriberServiceClient client)

A SubscriberServiceClient to use, if present.

Parameter
NameDescription
clientSubscriberServiceClient
Returns
TypeDescription
SubscriberSettings.Builder

setSubscriptionPath(SubscriptionPath path)

public abstract SubscriberSettings.Builder setSubscriptionPath(SubscriptionPath path)

The subscription to use to receive messages.

Parameter
NameDescription
pathSubscriptionPath
Returns
TypeDescription
SubscriberSettings.Builder

setTransformer(MessageTransformer<SequencedMessage,PubsubMessage> transformer)

public abstract SubscriberSettings.Builder setTransformer(MessageTransformer<SequencedMessage,PubsubMessage> transformer)

The MessageTransformer to get PubsubMessages from Pub/Sub Lite wire messages. The messageId field must not be set on the returned message.

Parameter
NameDescription
transformerMessageTransformer<SequencedMessage,com.google.pubsub.v1.PubsubMessage>
Returns
TypeDescription
SubscriberSettings.Builder