merlimat commented on a change in pull request #2961: Added pause and resume to 
Java client Consumer
URL: https://github.com/apache/pulsar/pull/2961#discussion_r232026408
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/api/Consumer.java
 ##########
 @@ -294,4 +294,14 @@
      * @return consumer name.
      */
     String getConsumerName();
+
+    /**
+     * Stop requesting new messages from the broker until {@link #resume()} is 
called.
+     */
+    void pause();
 
 Review comment:
   Barring the fact that pause/resume are clear in the context of listener, the 
only concern I have here is how `pause()` will interact with `receive()`. 
   With this implementation, after calling `pause()`, a call to `receive()` 
might get blocked indefinitely. 
   
   The question is should we allow this behavior or just make pause/resume to 
take effect on the listener. In either case, we should note that in this 
Javadoc.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to