You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/22 03:01:03 UTC

[GitHub] [pulsar] codelipenghui commented on a diff in pull request #16160: [improve][java-client] Only trigger the batch receive timeout when having pending batch receives requests

codelipenghui commented on code in PR #16160:
URL: https://github.com/apache/pulsar/pull/16160#discussion_r903238224


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerBase.java:
##########
@@ -164,12 +164,14 @@ protected ConsumerBase(PulsarClientImpl client, String topic, ConsumerConfigurat
             this.batchReceivePolicy = BatchReceivePolicy.DEFAULT_POLICY;
         }
 
+        initReceiverQueueSize();
+    }
+
+    protected void triggerBatchReceiveTimeoutTask() {

Review Comment:
   > If I am reading this correctly, this method will get called with every call to batchReceive or batchReceiveAsync.
   
   No, we only call this method if no messages in the receiver queue. 
   
   > I think this method should only schedule a timer task when batchReceiveTimeout is null.
   
   Yes, make sense. I think I missed this part.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org