horizonzy opened a new issue, #16358:
URL: https://github.com/apache/pulsar/issues/16358

   **Describe the bug**
   
   Now the method `hasMessageAvailable` just is announced in ConsumerImpl and 
MultiConsumerImpl. 
   If we want to check is there message available, we should transfer Consumer 
to ConsumerImpl or MultiConsumerImpl, 
   then invoke hasMessageAvailable like below:
   ```
               if (consumer instanceof ConsumerImpl<RubbishInfo>) {
                   return ((ConsumerImpl<RubbishInfo>) 
consumer).hasMessageAvailable();
               } else if (consumer instanceof 
MultiTopicsConsumerImpl<RubbishInfo>) {
                   return ((MultiTopicsConsumerImpl<RubbishInfo>) 
consumer).hasMessageAvailable();
               }
   ```
   
   Maybe we can make method `hasMessageAvailable` to Consumer.


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