pulsar-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] sijie commented on issue #937: Allow reader to detect when it's caught up with writers
Date Thu, 01 Jan 1970 00:00:00 GMT
sijie commented on issue #937: Allow reader to detect when it's caught up with writers
URL: https://github.com/apache/incubator-pulsar/issues/937#issuecomment-349073977
 
 
   I am not sure if I understand this correctly. can it achieve by providing a `getLastMessageId()`
call at reader?
   
   so the reader logic can be:
   
   ```
   MessageId lastMsgId = reader.getLastMessageId();
   
   Message msg;
   
   while (reader.hasNext()) {
       msg = reader.readNext();
   
      // process your messages here
   
      if (msg.getMessageId().compareTo(lastMsgId) == 0) {
           break;
      }
   }
   ```
   

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

Mime
View raw message