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 2020/03/18 10:33:39 UTC

[GitHub] [pulsar] Lanayx commented on a change in pull request #6345: [Java Reader Client] Start reader inside batch result in read first message in batch.

Lanayx commented on a change in pull request #6345: [Java Reader Client] Start reader inside batch result in read first message in batch.
URL: https://github.com/apache/pulsar/pull/6345#discussion_r394247606
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
 ##########
 @@ -1520,7 +1536,10 @@ public void seek(long timestamp) throws PulsarClientException {
         cnx.sendRequestWithId(seek, requestId).thenRun(() -> {
             log.info("[{}][{}] Successfully reset subscription to message id {}", topic, subscription, messageId);
             acknowledgmentsGroupingTracker.flushAndClean();
-            lastDequeuedMessage = messageId;
+
+            seekMessageId = new BatchMessageIdImpl((MessageIdImpl) messageId);
+            duringSeek.set(true);
 
 Review comment:
   Hi! Looks like this commit is a breaking change, it broke my unit test. The logic of unit test is as follows
   1) Read 10 messages
   2) Seek back to the first
   3) Read 10 messages again
   Earlier `hasMessageAvailableAsync` returned true on [this line](url) because `lastDequeuedMessage` was reset, but now it returns false which leads to getLastMessageIdAsync execution. And because seek drops connection, `getLastMessageIdAsync` fails for me with server error "_Error: MetadataError. Message: Consumer not found_", sot the test fails

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