Jason918 commented on code in PR #15107:
URL: https://github.com/apache/pulsar/pull/15107#discussion_r846905545


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -1419,40 +1428,38 @@ private ByteBuf processMessageChunk(ByteBuf 
compressedPayload, MessageMetadata m
      * Notify waiting asyncReceive request with the received message.
      *
      * @param message
+     * @return the message is enqueue incomingMessages.
      */
-    void notifyPendingReceivedCallback(final Message<T> message, Exception 
exception) {
-        if (pendingReceives.isEmpty()) {
-            return;
-        }
-
+    boolean notifyPendingReceivedCallback(final Message<T> message, Exception 
exception) {
         // fetch receivedCallback from queue
         final CompletableFuture<Message<T>> receivedFuture = 
nextPendingReceive();
         if (receivedFuture == null) {
-            return;
+            return message != null && getCurrentReceiverQueueSize() != 0;

Review Comment:
   Can we just return true here? 



##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java:
##########
@@ -1419,40 +1428,38 @@ private ByteBuf processMessageChunk(ByteBuf 
compressedPayload, MessageMetadata m
      * Notify waiting asyncReceive request with the received message.
      *
      * @param message
+     * @return the message is enqueue incomingMessages.

Review Comment:
   Maybe it's better revert the logic, return true if this message is handled 
by pending receive.



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