I'm looking at tuning my celery/rabbitmq installation, and I found this article:
http://www.lshift.net/blog/2015/04/30/making-celery-play-nice-with-rabbitmq-and-bigwig/
It mentions doing the setting BROKER_TRANSPORT_OPTIONS = {'confirm_publish': True}
if you want to guarantee message delivery (which I do). I'm having trouble finding any documentation on this setting for either rabbitmq or celery.
What is the correct way to confirm a publish in celery with rabbitmq? Where is the documentation for said feature?
So to answer my own question: There is currently no documentation.
That said, I dug the source code for most of a morning and found the answer here:
https://github.com/celery/py-amqp/blob/24df1032db4a566e165f736ccb6b4a15cc94bcaa/amqp/channel.py#L1770-L1776
py-amqp
is the library that celery ultimately uses (via kombu--two packages deep here folks!). py-amqp
reads that setting and has a wait when the confirm_publish
option is set. This effectively makes a queuing process synchronous.
confirm_publish
option is used by py-amqp
library https://github.com/celery/py-amqp
It forces publish to block connection until confirmation is received from RabbitMQ.
RabbitMQ confirmations are described here: https://www.rabbitmq.com/confirms.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With