merlimat commented on a change in pull request #1066: Issue 937: add CommandGetLastMessageId to make reader know the end of topic URL: https://github.com/apache/incubator-pulsar/pull/1066#discussion_r166478918
########## File path: pulsar-client/src/main/java/org/apache/pulsar/client/api/Consumer.java ########## @@ -278,4 +277,18 @@ * @return a future to track the completion of the seek operation */ CompletableFuture<Void> seekAsync(MessageId messageId); + + /** + * Check if there is message that has been published successfully to the broker in the topic. + * + * Note: this operation can only be done on non-partitioned persistent topics. + * For partitioned topics, one can rather perform the hasMessageAvailable on the individual partitions. + */ + Boolean hasMessageAvailable() throws PulsarClientException; + + /** + * Asynchronously Check if there is message that has been published successfully to the broker in the topic. + */ + CompletableFuture<Boolean> hasMessageAvailableAsync(); Review comment: I think this feature is mostly useful on the `Reader` interface. I think we should hide it from here, at least until we can find a concrete use case for it. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services