michaeljmarshall commented on a change in pull request #14400:
URL: https://github.com/apache/pulsar/pull/14400#discussion_r813032788



##########
File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java
##########
@@ -721,9 +725,7 @@ public String toString() {
                 + '}';
     }
 
-    protected void setMaxReceiverQueueSize(int newSize) {
-        this.maxReceiverQueueSize = newSize;
-    }
+    protected abstract void setMaxReceiverQueueSize(int newSize);

Review comment:
       I think we could add this method to the `Consumer` interface. That would 
allow us to make it a first class member of the API, which would also make it 
easier to document for end users via the Javadoc. The related 
`receiverQueueSize` is defined on the `ConsumerBuilder`, so there is already a 
precedent for this kind of method being on the top level interface. Let me know 
what you think.
   
   Additionally, note that this method is currently exposed to the 
`ZeroQueueConsumerImpl` and would result in the consumer sending flow control 
permits. I think we should throw a `NotImplemented` exception in that class 
since the whole point of that class is that the queue is size 0. Assuming we go 
in this direction, we'll need to update the `ConsumerBuilder#receiverQueueSize` 
javadoc to indicate that consumers with size 0 are not eligible for queue 
resizing.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to