class documentation

class Reader: (source)

View In Hierarchy

Pulsar topic reader.

Method close Close the reader.
Method has_message_available Check if there is any message available to read from the current position.
Method is_connected Check if the reader is connected or not.
Method read_next Read a single message.
Method seek Reset this reader to a specific message id or publish timestamp. The message id can either be a specific message or represent the first or last messages in the topic. Note: this operation can only be done on non-partitioned topics...
Method topic Return the topic this reader is reading from.
def close(self): (source)

Close the reader.

def has_message_available(self): (source)

Check if there is any message available to read from the current position.

def is_connected(self): (source)

Check if the reader is connected or not.

def read_next(self, timeout_millis=None): (source)

Read a single message.

If a message is not immediately available, this method will block until a new message is available.

Parameters
timeout_millis:int, optionalIf specified, the receiver will raise an exception if a message is not available within the timeout.
def seek(self, messageid): (source)

Reset this reader to a specific message id or publish timestamp. The message id can either be a specific message or represent the first or last messages in the topic. Note: this operation can only be done on non-partitioned topics. For these, one can rather perform the seek() on the individual partitions.

Parameters
messageidThe message id for seek, OR an integer event time to seek to
def topic(self): (source)

Return the topic this reader is reading from.