public abstract static class SubscriberSettings.Builder
Constructors
Builder()
Methods
build()
public abstract SubscriberSettings build()
Returns
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
Returns
setCredentialsProvider(CredentialsProvider provider)
public abstract SubscriberSettings.Builder setCredentialsProvider(CredentialsProvider provider)
A provider for credentials.
Parameter
Returns
setCursorServiceClient(CursorServiceClient client)
public abstract SubscriberSettings.Builder setCursorServiceClient(CursorServiceClient client)
A CursorServiceClient to use, if present.
Parameter
Returns
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
Returns
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
Returns
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
Returns
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
Returns
setReassignmentHandler(ReassignmentHandler reassignmentHandler)
public abstract SubscriberSettings.Builder setReassignmentHandler(ReassignmentHandler reassignmentHandler)
A handler that will be notified when partition assignments change from the backend.
Parameter
Returns
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
Name | Description |
receiver | com.google.cloud.pubsub.v1.MessageReceiver
|
Returns
setSubscriberServiceClient(SubscriberServiceClient client)
public abstract SubscriberSettings.Builder setSubscriberServiceClient(SubscriberServiceClient client)
A SubscriberServiceClient to use, if present.
Parameter
Returns
setSubscriptionPath(SubscriptionPath path)
public abstract SubscriberSettings.Builder setSubscriptionPath(SubscriptionPath path)
The subscription to use to receive messages.
Parameter
Returns
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
Returns