Class SubscriberSettings.Builder

java.lang.Object
com.google.cloud.pubsublite.cloudpubsub.SubscriberSettings.Builder
Enclosing class:
SubscriberSettings

public abstract static class SubscriberSettings.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setReceiver

      public abstract SubscriberSettings.Builder setReceiver(com.google.cloud.pubsub.v1.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.
    • setSubscriptionPath

      public abstract SubscriberSettings.Builder setSubscriptionPath(SubscriptionPath path)
      The subscription to use to receive messages.
    • setPerPartitionFlowControlSettings

      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.
    • setPartitions

      public abstract SubscriberSettings.Builder setPartitions(List<Partition> partition)
      The partitions this subscriber should connect to to receive messages. If set, disables auto-assignment.
    • setTransformer

      public abstract SubscriberSettings.Builder setTransformer(MessageTransformer<SequencedMessage,com.google.pubsub.v1.PubsubMessage> transformer)
      The MessageTransformer to get PubsubMessages from Pub/Sub Lite wire messages. The messageId field must not be set on the returned message.
    • setCredentialsProvider

      public abstract SubscriberSettings.Builder setCredentialsProvider(com.google.api.gax.core.CredentialsProvider provider)
      A provider for credentials.
    • setFramework

      public abstract SubscriberSettings.Builder setFramework(PubsubContext.Framework framework)
      A Framework tag for internal metrics. Please set this if integrating with a public framework!
    • setSubscriberServiceClient

      public abstract SubscriberSettings.Builder setSubscriberServiceClient(SubscriberServiceClient client)
      A SubscriberServiceClient to use, if present.
    • setCursorServiceClient

      public abstract SubscriberSettings.Builder setCursorServiceClient(CursorServiceClient client)
      A CursorServiceClient to use, if present.
    • setAssignmentServiceClient

      public abstract SubscriberSettings.Builder setAssignmentServiceClient(PartitionAssignmentServiceClient client)
      A client to connect to the Pub/Sub lite assignment service. If present, ignores CredentialsProvider.
    • setNackHandler

      public abstract SubscriberSettings.Builder setNackHandler(NackHandler nackHandler)
      A handler for the action to take when 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.
    • setReassignmentHandler

      public abstract SubscriberSettings.Builder setReassignmentHandler(ReassignmentHandler reassignmentHandler)
      A handler that will be notified when partition assignments change from the backend.
    • build

      public abstract SubscriberSettings build()