class documentation

The Pulsar topic reader, used to read messages from a topic.

Method __init__ Create the reader. Users should not call this constructor directly. Instead, create the reader via Client.create_reader.
Async Method close Close the reader asynchronously.
Async 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.
Async Method read_next Read a single message asynchronously.
Async Method seek Reset this reader to a specific message id or publish timestamp asynchronously.
Method topic Return the topic this reader is reading from.
Instance Variable _reader Undocumented
Instance Variable _schema Undocumented
def __init__(self, reader: _pulsar.Reader, schema: pulsar.schema.Schema): (source)

Create the reader. Users should not call this constructor directly. Instead, create the reader via Client.create_reader.

Parameters
reader:_pulsar.ReaderThe underlying Reader object from the C extension.
schema:pulsar.schema.SchemaThe schema of the data that will be received by this reader.
async def close(self): (source)

Close the reader asynchronously.

Raises
PulsarException
async def has_message_available(self) -> bool: (source)

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

def is_connected(self) -> bool: (source)

Check if the reader is connected or not.

async def read_next(self) -> pulsar.Message: (source)

Read a single message asynchronously.

Returns
pulsar.MessageThe message received.
Raises
PulsarException
async def seek(self, messageid: pulsar.MessageId | int): (source)

Reset this reader to a specific message id or publish timestamp asynchronously.

Parameters
messageid:MessageId or intThe message id for seek, OR an integer event time (timestamp) to seek to.
Raises
PulsarException
def topic(self) -> str: (source)

Return the topic this reader is reading from.

Undocumented

Undocumented