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 | get |
Asynchronously get the last message id. |
| Async Method | negative |
Acknowledge the failure to process a single message asynchronously. |
| Async Method | receive |
Receive a single message asynchronously. |
| Method | redeliver |
Redelivers all the unacknowledged messages. In failover mode, the request is ignored if the consumer is not active for the given topic. In shared mode, the consumer's messages to be redelivered are distributed across all the connected consumers... |
| 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. |
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 | |
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 | |
pulsar.Message | pulsar.MessageId | _pulsar.Message | _pulsar.MessageId):
(source)
¶
Acknowledge the failure to process a single message asynchronously.
When a message is "negatively acked" it will be marked for redelivery after some fixed delay. The delay is configurable when constructing the consumer with {@link ConsumerConfiguration#setNegativeAckRedeliveryDelayMs}. This call is not blocking.
| Parameters | |
message:pulsar.Message | pulsar.MessageId | _pulsar.Message | _pulsar.MessageId | The received message or message id. |
Receive a single message asynchronously.
| Returns | |
pulsar.Message | The message received. |
| Raises | |
PulsarException | |
Redelivers all the unacknowledged messages. In failover mode, the request is ignored if the consumer is not active for the given topic. In shared mode, the consumer's messages to be redelivered are distributed across all the connected consumers. This is a non-blocking call and doesn't throw an exception. In case the connection breaks, the messages are redelivered after reconnect.
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 | |