Package org.apache.pulsar.client.impl
Class RawReaderImpl
java.lang.Object
org.apache.pulsar.client.impl.RawReaderImpl
- All Implemented Interfaces:
RawReader
-
Constructor Summary
ConstructorsConstructorDescriptionRawReaderImpl(org.apache.pulsar.client.impl.PulsarClientImpl client, String topic, String subscription, CompletableFuture<org.apache.pulsar.client.api.Consumer<byte[]>> consumerFuture) -
Method Summary
Modifier and TypeMethodDescriptionacknowledgeCumulativeAsync(org.apache.pulsar.client.api.MessageId messageId, Map<String, Long> properties) Acknowledge all messages as read up until messageId.Close the raw reader.CompletableFuture<org.apache.pulsar.client.api.MessageId>Get the last message id available immediately available for reading.getTopic()Get the topic for the reader.Check if there is any message available to read.Read the next raw message for the topic.seekAsync(org.apache.pulsar.client.api.MessageId messageId) Seek to a location in the topic.toString()
-
Constructor Details
-
RawReaderImpl
public RawReaderImpl(org.apache.pulsar.client.impl.PulsarClientImpl client, String topic, String subscription, CompletableFuture<org.apache.pulsar.client.api.Consumer<byte[]>> consumerFuture)
-
-
Method Details
-
getTopic
Description copied from interface:RawReaderGet the topic for the reader. -
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
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
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 CompletableFuture<Void> acknowledgeCumulativeAsync(org.apache.pulsar.client.api.MessageId messageId, Map<String, 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
Description copied from interface:RawReaderClose the raw reader.- Specified by:
closeAsyncin interfaceRawReader
-
getLastMessageIdAsync
Description copied from interface:RawReaderGet the last message id available immediately available for reading.- Specified by:
getLastMessageIdAsyncin interfaceRawReader
-
toString
-