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


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java:
##########
@@ -268,7 +275,7 @@ private void receiveMessageFromConsumer(ConsumerImpl<T> 
consumer) {
             } else {
                 // Call receiveAsync() if the incoming queue is not full. 
Because this block is run with
                 // thenAcceptAsync, there is no chance for recursion that 
would lead to stack overflow.
-                receiveMessageFromConsumer(consumer);
+                receiveMessageFromConsumer(consumer, messages.size() > 0);

Review Comment:
   Yes, if `messages.size() = 0`, the current round of receive messages from 
the internal consumer will use `consumer.receiveAsync()`. After the internal 
consumer has new incoming messages, the next round will use the 
`batchReceiveAsync()` again.



-- 
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