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 2019/03/16 05:53:22 UTC

[GitHub] [pulsar] codelipenghui commented on a change in pull request #3830: Fix read batching message by pulsar reader

codelipenghui commented on a change in pull request #3830: Fix read batching message by pulsar reader
URL: https://github.com/apache/pulsar/pull/3830#discussion_r266190359
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
 ##########
 @@ -1431,6 +1428,15 @@ public boolean hasMessageAvailable() throws PulsarClientException {
         return booleanFuture;
     }
 
+    private boolean hasMoreMessages(MessageId lastMessageIdInBroker, MessageId lastDequeuedMessage) {
+        return (lastMessageIdInBroker.compareTo(lastDequeuedMessage) > 0 ||
+                // Make sure batch message can be read completely.
+                lastDequeuedMessage instanceof BatchMessageIdImpl
+                        && lastMessageIdInBroker.compareTo(lastDequeuedMessage) >= 0
+                        && incomingMessages.size() > 0)
+                && ((MessageIdImpl)lastMessageIdInBroker).getEntryId() != -1;
 
 Review comment:
   @merlimat Thanks, more clearer. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services