public interface Reader<T>
extends Closeable
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Void> |
closeAsync()
Asynchronously close the reader and stop the broker to push more messages
|
String |
getTopic() |
boolean |
hasMessageAvailable()
Check if there is any message available to read from the current position.
|
CompletableFuture<Boolean> |
hasMessageAvailableAsync()
Asynchronously Check if there is message that has been published successfully to the broker in the topic.
|
boolean |
hasReachedEndOfTopic()
Return true if the topic was terminated and this reader has reached the end of the topic
|
boolean |
isConnected() |
Message<T> |
readNext()
Read the next message in the topic
|
Message<T> |
readNext(int timeout,
TimeUnit unit)
Read the next message in the topic waiting for a maximum of timeout
time units.
|
CompletableFuture<Message<T>> |
readNextAsync() |
String getTopic()
Message<T> readNext() throws PulsarClientException
PulsarClientException
Message<T> readNext(int timeout, TimeUnit unit) throws PulsarClientException
PulsarClientException
CompletableFuture<Void> closeAsync()
boolean hasReachedEndOfTopic()
boolean hasMessageAvailable() throws PulsarClientException
PulsarClientException
CompletableFuture<Boolean> hasMessageAvailableAsync()
boolean isConnected()