You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by gi...@git.apache.org on 2017/08/30 00:07:34 UTC

[GitHub] merlimat commented on a change in pull request #720: Position Reader on a specific message within a batch

merlimat commented on a change in pull request #720: Position Reader on a specific message within a batch
URL: https://github.com/apache/incubator-pulsar/pull/720#discussion_r135942837
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
 ##########
 @@ -859,6 +865,21 @@ void receiveIndividualMessagesFromBatch(MessageMetadata msgMetadata, ByteBuf unc
                     .newBuilder();
                 ByteBuf singleMessagePayload = Commands.deSerializeSingleMessageInBatch(uncompressedPayload,
                     singleMessageMetadataBuilder, i, batchSize);
+
+                if (startMessageId != null
+                        && messageId.getLedgerId() == startMessageId.getLedgerId()
+                        && messageId.getEntryId() == startMessageId.getEntryId()
+                        && i <= startMessageId.getBatchIndex()) {
+                    // If we are receiving a batch message, we need to discard messages that were prior
+                    // to the startMessageId
 
 Review comment:
   I think that checking everything in client side gets a bit more complicated for the comparison. Also we'd have to do it in 2 places one for batch messages and one for regular. Plus in C++ and Java.
 
----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services