diff --git a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ClientBuilder.java b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ClientBuilder.java index 7bf1a03d3f455..7b70017a84358 100644 --- a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ClientBuilder.java +++ b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ClientBuilder.java @@ -437,9 +437,8 @@ ClientBuilder authentication(String authPluginClassName, Map aut ClientBuilder tlsProtocols(Set tlsProtocols); /** - * Configure a limit on the amount of direct memory that will be allocated by this client instance. - *

- * Note: at this moment this is only limiting the memory for producers. + * Configure a limit on the amount of direct memory that will be allocated by this client instance + * (default: 64 MB). *

* Setting this to 0 will disable the limit. * diff --git a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ConsumerBuilder.java b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ConsumerBuilder.java index e2a166572e60a..5318dde28dbd2 100644 --- a/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ConsumerBuilder.java +++ b/pulsar-client-api/src/main/java/org/apache/pulsar/client/api/ConsumerBuilder.java @@ -837,13 +837,16 @@ public interface ConsumerBuilder extends Cloneable { /** * If this is enabled, the consumer receiver queue size is initialized as a very small value, 1 by default, - * and will double itself until it reaches the value set by {@link #receiverQueueSize(int)}, if and only if: + * and will double itself until it reaches either the value set by {@link #receiverQueueSize(int)} or the client + * memory limit set by {@link ClientBuilder#memoryLimit(long, SizeUnit)}. + * + *

The consumer receiver queue size will double if and only if: *

1) User calls receive() and there are no messages in receiver queue. *

2) The last message we put in the receiver queue took the last space available in receiver queue. * - * This is disabled by default and currentReceiverQueueSize is initialized as maxReceiverQueueSize. + *

This is disabled by default and currentReceiverQueueSize is initialized as maxReceiverQueueSize. * - * The feature should be able to reduce client memory usage. + *

The feature should be able to reduce client memory usage. * * @param enabled whether to enable AutoScaledReceiverQueueSize. */