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