maimom1924 opened a new issue #9330:
URL: https://github.com/apache/pulsar/issues/9330


   I want to read last message from topic "A"  by using Pulsar Reader as shown 
in below code:
   
   ```
   Reader<byte[]> reader= pulsarClient.newReader()
                       .topic("A")
                       .startMessageIdInclusive()
                       .startMessageId(MessageId.latest)
                       .create();
   if(reader.hasMessageAvailable()) {
       Message<byte[]> msg= reader.readNext();
   }
   ```
   I have produced many messages on that topic and  as the result:
   - The `msg` that I get here is not the last message but `the last message - 
1` when I add ` .startMessageIdInclusive()`
   - Without adding ` .startMessageIdInclusive()`, 
`reader.hasMessageAvailable()` will return false. 
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to