Class RawReaderImpl

java.lang.Object
org.apache.pulsar.client.impl.RawReaderImpl
All Implemented Interfaces:
RawReader

public class RawReaderImpl extends Object implements RawReader
  • 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

      public String getTopic()
      Description copied from interface: RawReader
      Get the topic for the reader.
      Specified by:
      getTopic in interface RawReader
      Returns:
      topic for the reader
    • hasMessageAvailableAsync

      public CompletableFuture<Boolean> hasMessageAvailableAsync()
      Description copied from interface: RawReader
      Check if there is any message available to read.
      Specified by:
      hasMessageAvailableAsync in interface RawReader
      Returns:
      a completable future which will return whether there is any message available to read.
    • seekAsync

      public CompletableFuture<Void> seekAsync(org.apache.pulsar.client.api.MessageId messageId)
      Description copied from interface: RawReader
      Seek to a location in the topic. After the seek, the first message read will be the one with with the specified message ID.
      Specified by:
      seekAsync in interface RawReader
      Parameters:
      messageId - the message ID to seek to
    • readNextAsync

      public CompletableFuture<RawMessage> readNextAsync()
      Description copied from interface: RawReader
      Read the next raw message for the topic.
      Specified by:
      readNextAsync in interface RawReader
      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: RawReader
      Acknowledge 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:
      acknowledgeCumulativeAsync in interface RawReader
      Parameters:
      messageId - to cumulatively acknowledge to
      properties - a map of properties which will be stored with the acknowledgement
    • closeAsync

      public CompletableFuture<Void> closeAsync()
      Description copied from interface: RawReader
      Close the raw reader.
      Specified by:
      closeAsync in interface RawReader
    • getLastMessageIdAsync

      public CompletableFuture<org.apache.pulsar.client.api.MessageId> getLastMessageIdAsync()
      Description copied from interface: RawReader
      Get the last message id available immediately available for reading.
      Specified by:
      getLastMessageIdAsync in interface RawReader
    • toString

      public String toString()
      Overrides:
      toString in class Object