aloyszhang opened a new issue #7796:
URL: https://github.com/apache/pulsar/issues/7796


   **Describe the bug**
   `Reader#hasMessageAvailable` is used for  checking  if there is any message 
available to read from the current position.
   But in this case:
   1. `Reader#seek`  a time after the publish time of the last message
   2. `Reader#hasMessageAvailable` still return true and  `Reader#readNext` 
will be blocked 
   It  looks unseemly, `Reader#hasMessageAvailable` shoule gives false since 
there no more new messages to read.
   The reason it that `Reader#hasMessageAvailable` will finally call  
`ConsumerImpl#getLastMessageIdAsync` which just return the last messageId.  
   `Reader#seek` has no effect on `Reader#hasMessageAvailable.` 
   Related issue  [#7775 ]
   **To Reproduce**
   1. `Reader#seek`  a time after the publish time of the last message
   2. `Reader#hasMessageAvailable` still return true
   
   **Expected behavior**
   `Reader#hasMessageAvailable` shoule gives false if there no more new 
messages to read.
   


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