Why is RabbitMQ not persisting messages on a durable queue?

后端 未结 2 1159
南旧
南旧 2021-02-03 10:59

I am using RabbitMQ with Django through Celery. I am using the most basic setup:

# RabbitMQ connection settings
BROKER_HOST = \'localhost\'
BROKER_PORT = \'5672\         


        
2条回答
  •  别那么骄傲
    2021-02-03 11:38

    Making a queue durable is not the same as making the messages on it persistent. Durable queues mean they come up again automatically when the server has restarted - which has obviously happened in your case. But this doesn't affect the messages themselves.

    To make messages persistent, you have to also mark the message's delivery_mode property to 2. See the classic write-up Rabbits and Warrens for a full explanation.

    Edit: Full link is broken, but as of Dec 2013 you could still find the blog post from the main URL: http://blogs.digitar.com/jjww/

提交回复
热议问题