You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/07/03 12:48:56 UTC

[GitHub] [pulsar] horizonzy opened a new issue, #16358: Discuss: Make hasMessageAvailable to interface Consumer.

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: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] github-actions[bot] commented on issue #16358: Discuss: Make hasMessageAvailable to interface Consumer.

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #16358:
URL: https://github.com/apache/pulsar/issues/16358#issuecomment-1205963442

   The issue had no activity for 30 days, mark with Stale label.


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] Technoboy- commented on issue #16358: Discuss: Make hasMessageAvailable to interface Consumer.

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on issue #16358:
URL: https://github.com/apache/pulsar/issues/16358#issuecomment-1174567722

   > What are the scenarios for consumers to use `hasMessageAvailable`?
   
   I think it's the same with adding `getLastMessageId`(#1066).
   BTW, there is a case here : https://github.com/apache/pulsar/pull/1066#discussion_r162751622


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] shibd commented on issue #16358: Discuss: Make hasMessageAvailable to interface Consumer.

Posted by GitBox <gi...@apache.org>.
shibd commented on issue #16358:
URL: https://github.com/apache/pulsar/issues/16358#issuecomment-1173602415

   What are the scenarios for consumers to use `hasMessageAvailable`?


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] horizonzy commented on issue #16358: Discuss: Make hasMessageAvailable to interface Consumer.

Posted by GitBox <gi...@apache.org>.
horizonzy commented on issue #16358:
URL: https://github.com/apache/pulsar/issues/16358#issuecomment-1174622951

   > What are the scenarios for consumers to use `hasMessageAvailable`?
   
   Sorry for delay reply. 
   Not the method hasMessageAvailable is defined in both ConsumerImpl and MultiConsumerImpl.
   
   https://github.com/apache/pulsar/blob/aabd5d020543210921f10648caf6720adc41d651/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L2188
   
   https://github.com/apache/pulsar/blob/aabd5d020543210921f10648caf6720adc41d651/pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java#L811
   
   The behavior is same. So I think the method should upper to parent file `BaseConsumer` or `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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org