Demogorgon314 opened a new pull request #13332:
URL: https://github.com/apache/pulsar/pull/13332


   ### Motivation
   
   When we use a multi-topic reader, the `hasMessageAvailable` method might 
have the wrong behavior, since the multi-topics consumer receives all messages 
from the single-topic consumer, the single-topic consumer `hasMessageAvailable` 
might always be `false` (The lastDequeuedMessageId reach to the end of the 
queue, all message enqueue to multi-topic consumer's `incomingMessages` queue). 
   
   We should check the multi-topics consumer  `incomingMessages` size > 0 when 
calling `hasMessageAvailable `.
   
   ### Modifications
   
   1. Add a check of `incomingMessages` size > 0 
   2. Add units test `testHasMessageAvailableAsync` to verify the behavior.
   
   ### Documentation
   
   Need to update docs? 
   
   - [ ] `doc-required` 
     
     (If you need help on updating docs, create a doc issue)
     
   - [x] `no-need-doc` 
     
     (Please explain why)
     
   - [ ] `doc` 
     
     (If this PR contains doc changes)
   
   
   


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to