Package org.apache.pulsar.client.impl
Class RawReaderImpl
- java.lang.Object
-
- org.apache.pulsar.client.impl.RawReaderImpl
-
-
Constructor Summary
Constructors Constructor Description RawReaderImpl(org.apache.pulsar.client.impl.PulsarClientImpl client, java.lang.String topic, java.lang.String subscription, java.util.concurrent.CompletableFuture<org.apache.pulsar.client.api.Consumer<byte[]>> consumerFuture)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.lang.Void>acknowledgeCumulativeAsync(org.apache.pulsar.client.api.MessageId messageId, java.util.Map<java.lang.String,java.lang.Long> properties)Acknowledge all messages as read up until messageId.java.util.concurrent.CompletableFuture<java.lang.Void>closeAsync()Close the raw reader.java.util.concurrent.CompletableFuture<org.apache.pulsar.client.api.MessageId>getLastMessageIdAsync()Get the last message id available immediately available for reading.java.lang.StringgetTopic()Get the topic for the reader.java.util.concurrent.CompletableFuture<java.lang.Boolean>hasMessageAvailableAsync()Check if there is any message available to read.java.util.concurrent.CompletableFuture<RawMessage>readNextAsync()Read the next raw message for the topic.java.util.concurrent.CompletableFuture<java.lang.Void>seekAsync(org.apache.pulsar.client.api.MessageId messageId)Seek to a location in the topic.java.lang.StringtoString()
-
-
-
Method Detail
-
getTopic
public java.lang.String getTopic()
Description copied from interface:RawReaderGet the topic for the reader.
-
hasMessageAvailableAsync
public java.util.concurrent.CompletableFuture<java.lang.Boolean> hasMessageAvailableAsync()
Description copied from interface:RawReaderCheck if there is any message available to read.- Specified by:
hasMessageAvailableAsyncin interfaceRawReader- Returns:
- a completable future which will return whether there is any message available to read.
-
seekAsync
public java.util.concurrent.CompletableFuture<java.lang.Void> seekAsync(org.apache.pulsar.client.api.MessageId messageId)
Description copied from interface:RawReaderSeek to a location in the topic. After the seek, the first message read will be the one with with the specified message ID.
-
readNextAsync
public java.util.concurrent.CompletableFuture<RawMessage> readNextAsync()
Description copied from interface:RawReaderRead the next raw message for the topic.- Specified by:
readNextAsyncin interfaceRawReader- Returns:
- a completable future which will return the next RawMessage in the topic.
-
acknowledgeCumulativeAsync
public java.util.concurrent.CompletableFuture<java.lang.Void> acknowledgeCumulativeAsync(org.apache.pulsar.client.api.MessageId messageId, java.util.Map<java.lang.String,java.lang.Long> properties)Description copied from interface:RawReaderAcknowledge all messages as read up until messageId. The properties are stored with the individual acknowledgement, so later acknowledgements will overwrite all properties from previous acknowledgements.- Specified by:
acknowledgeCumulativeAsyncin interfaceRawReader- Parameters:
messageId- to cumulatively acknowledge toproperties- a map of properties which will be stored with the acknowledgement
-
closeAsync
public java.util.concurrent.CompletableFuture<java.lang.Void> closeAsync()
Description copied from interface:RawReaderClose the raw reader.- Specified by:
closeAsyncin interfaceRawReader
-
getLastMessageIdAsync
public java.util.concurrent.CompletableFuture<org.apache.pulsar.client.api.MessageId> getLastMessageIdAsync()
Description copied from interface:RawReaderGet the last message id available immediately available for reading.- Specified by:
getLastMessageIdAsyncin interfaceRawReader
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-