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.
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class SubscriberSettings.Builder (1.15.13)\n\nVersion latestkeyboard_arrow_down\n\n- [1.15.13 (latest)](/java/docs/reference/google-cloud-pubsublite/latest/com.google.cloud.pubsublite.cloudpubsub.SubscriberSettings.Builder)\n- [1.15.12](/java/docs/reference/google-cloud-pubsublite/1.15.12/com.google.cloud.pubsublite.cloudpubsub.SubscriberSettings.Builder)\n- [1.14.8](/java/docs/reference/google-cloud-pubsublite/1.14.8/com.google.cloud.pubsublite.cloudpubsub.SubscriberSettings.Builder)\n- [1.13.8](/java/docs/reference/google-cloud-pubsublite/1.13.8/com.google.cloud.pubsublite.cloudpubsub.SubscriberSettings.Builder)\n- [1.12.22](/java/docs/reference/google-cloud-pubsublite/1.12.22/com.google.cloud.pubsublite.cloudpubsub.SubscriberSettings.Builder)\n- [1.11.2](/java/docs/reference/google-cloud-pubsublite/1.11.2/com.google.cloud.pubsublite.cloudpubsub.SubscriberSettings.Builder)\n- [1.10.0](/java/docs/reference/google-cloud-pubsublite/1.10.0/com.google.cloud.pubsublite.cloudpubsub.SubscriberSettings.Builder)\n- [1.9.4](/java/docs/reference/google-cloud-pubsublite/1.9.4/com.google.cloud.pubsublite.cloudpubsub.SubscriberSettings.Builder)\n- [1.8.0](/java/docs/reference/google-cloud-pubsublite/1.8.0/com.google.cloud.pubsublite.cloudpubsub.SubscriberSettings.Builder)\n- [1.7.1](/java/docs/reference/google-cloud-pubsublite/1.7.1/com.google.cloud.pubsublite.cloudpubsub.SubscriberSettings.Builder)\n- [1.6.3](/java/docs/reference/google-cloud-pubsublite/1.6.3/com.google.cloud.pubsublite.cloudpubsub.SubscriberSettings.Builder)\n- [1.5.5](/java/docs/reference/google-cloud-pubsublite/1.5.5/com.google.cloud.pubsublite.cloudpubsub.SubscriberSettings.Builder)\n- [1.4.12](/java/docs/reference/google-cloud-pubsublite/1.4.12/com.google.cloud.pubsublite.cloudpubsub.SubscriberSettings.Builder) \n\n public abstract static class SubscriberSettings.Builder\n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e SubscriberSettings.Builder \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nConstructors\n------------\n\n### Builder()\n\n public Builder()\n\nMethods\n-------\n\n### build()\n\n public abstract SubscriberSettings build()\n\n### setAssignmentServiceClient(PartitionAssignmentServiceClient client)\n\n public abstract SubscriberSettings.Builder setAssignmentServiceClient(PartitionAssignmentServiceClient client)\n\nA client to connect to the Pub/Sub lite assignment service. If present, ignores\nCredentialsProvider.\n\n### setCredentialsProvider(CredentialsProvider provider)\n\n public abstract SubscriberSettings.Builder setCredentialsProvider(CredentialsProvider provider)\n\nA provider for credentials.\n\n### setCursorServiceClient(CursorServiceClient client)\n\n public abstract SubscriberSettings.Builder setCursorServiceClient(CursorServiceClient client)\n\nA CursorServiceClient to use, if present.\n\n### setFramework(PubsubContext.Framework framework)\n\n public abstract SubscriberSettings.Builder setFramework(PubsubContext.Framework framework)\n\nA Framework tag for internal metrics. Please set this if integrating with a public framework!\n\n### setNackHandler(NackHandler nackHandler)\n\n public abstract SubscriberSettings.Builder setNackHandler(NackHandler nackHandler)\n\nA handler for the action to take when com.google.cloud.pubsub.v1.AckReplyConsumer#nack is called. In Pub/Sub Lite, only a single\nsubscriber for a given subscription is connected to any partition at a time, and there is no\nother client that may be able to handle messages.\n\n### setPartitions(List\\\u003cPartition\\\u003e partition)\n\n public abstract SubscriberSettings.Builder setPartitions(List\u003cPartition\u003e partition)\n\nThe partitions this subscriber should connect to to receive messages. If set, disables\nauto-assignment.\n\n### setPerPartitionFlowControlSettings(FlowControlSettings settings)\n\n public abstract SubscriberSettings.Builder setPerPartitionFlowControlSettings(FlowControlSettings settings)\n\nThe per-partition flow control settings. Because these apply per-partition, if you are using\nthem to bound memory usage, keep in mind the number of partitions in the associated topic.\n\n### setReassignmentHandler(ReassignmentHandler reassignmentHandler)\n\n public abstract SubscriberSettings.Builder setReassignmentHandler(ReassignmentHandler reassignmentHandler)\n\nA handler that will be notified when partition assignments change from the backend.\n\n### setReceiver(MessageReceiver receiver)\n\n public abstract SubscriberSettings.Builder setReceiver(MessageReceiver receiver)\n\nThe receiver which handles new messages sent by the Pub/Sub Lite system. Only one downcall\nfrom any connected partition will be outstanding at a time, and blocking in this receiver\ncallback will block forward progress.\n\n### setSubscriberServiceClient(SubscriberServiceClient client)\n\n public abstract SubscriberSettings.Builder setSubscriberServiceClient(SubscriberServiceClient client)\n\nA SubscriberServiceClient to use, if present.\n\n### setSubscriptionPath(SubscriptionPath path)\n\n public abstract SubscriberSettings.Builder setSubscriptionPath(SubscriptionPath path)\n\nThe subscription to use to receive messages.\n\n### setTransformer(MessageTransformer\\\u003cSequencedMessage,PubsubMessage\\\u003e transformer)\n\n public abstract SubscriberSettings.Builder setTransformer(MessageTransformer\u003cSequencedMessage,PubsubMessage\u003e transformer)\n\nThe MessageTransformer to get PubsubMessages from Pub/Sub Lite wire messages. The messageId\nfield must not be set on the returned message."]]