class documentation
The Pulsar message consumer, used to subscribe to messages from a topic.
| Method | __init__ |
Create the consumer. Users should not call this constructor directly. Instead, create the consumer via Client.subscribe. |
| Async Method | acknowledge |
Acknowledge the reception of a single message asynchronously. |
| Async Method | acknowledge |
Acknowledge the reception of all the messages in the stream up to (and including) the provided message asynchronously. |
| Async Method | close |
Close the consumer asynchronously. |
| Method | consumer |
Return the consumer name. |
| Async Method | receive |
Receive a single message asynchronously. |
| Async Method | seek |
Reset the subscription associated with this consumer to a specific message id or publish timestamp asynchronously. |
| Method | subscription |
Return the subscription name. |
| Method | topic |
Return the topic this consumer is subscribed to. |
| Async Method | unsubscribe |
Unsubscribe the current consumer from the topic asynchronously. |
| Instance Variable | _consumer |
Undocumented |
| Instance Variable | _schema |
Undocumented |
Create the consumer.
Users should not call this constructor directly. Instead, create the
consumer via Client.subscribe.
| Parameters | |
consumer:_pulsar.Consumer | The underlying Consumer object from the C extension. |
schema:pulsar.schema.Schema | The schema of the data that will be received by this consumer. |
async def acknowledge(self, message:
pulsar.Message | pulsar.MessageId | _pulsar.Message | _pulsar.MessageId):
(source)
¶
Acknowledge the reception of a single message asynchronously.
| Parameters | |
message:Message, MessageId, _pulsar.Message, _pulsar.MessageId | The received message or message id. |
| Raises | |
PulsarException | |
async def acknowledge_cumulative(self, message:
pulsar.Message | pulsar.MessageId | _pulsar.Message | _pulsar.MessageId):
(source)
¶
Acknowledge the reception of all the messages in the stream up to (and including) the provided message asynchronously.
| Parameters | |
message:Message, MessageId, _pulsar.Message, _pulsar.MessageId | The received message or message id. |
| Raises | |
PulsarException | |
Receive a single message asynchronously.
| Returns | |
pulsar.Message | The message received. |
| Raises | |
PulsarException | |
Reset the subscription associated with this consumer to a specific message id or publish timestamp asynchronously.
The message id can either be a specific message or represent the first or last messages in the topic.
| Parameters | |
messageid:MessageId or int | The message id for seek, OR an integer event time (timestamp) to seek to |
| Raises | |
PulsarException | |