maansthoernvik / rabbitmq_client

Client for a RabbitMQ server.
MIT License
9 stars 5 forks source link

Add manual ack mode to consume interface. #10

Closed maansthoernvik closed 2 years ago

maansthoernvik commented 2 years ago

Consumes shall be possible to manually acknowledge incoming messages, rather than always relying on the consumer's auto-ack. Auto-ack shall remain the default for BC purposes.

To enable manual ack mode, pass manual_ack=True to the consume interface function. Manual ack mode will lead to an additional kwarg being passed to the on_message_callback: "ack". This new kawrg is a function that when called sends a basic_ack for the message in question (the reason for on_message_callback being called).