in pulsar/__init__.py [0:0]
def acknowledge(self, message: Union[Message, MessageId, _pulsar.Message, _pulsar.MessageId]):
"""
Acknowledge the reception of a single message.
This method will block until an acknowledgement is sent to the broker.
After that, the message will not be re-delivered to this consumer.
Parameters
----------
message : Message, MessageId, _pulsar.Message, _pulsar.MessageId
The received message or message id.
Raises
------
OperationNotSupported
if ``message`` is not allowed to acknowledge
"""
if isinstance(message, Message):
self._consumer.acknowledge(message._message)
elif isinstance(message, MessageId):
self._consumer.acknowledge(message._msg_id)
else:
self._consumer.acknowledge(message)