Not sure of the celery underpinnings for specifying persistent messages, perhaps it's documented, but you need to set the message delivery_mode = 2 in the message properties when calling Basic.Publish.<br><br><div class="gmail_quote">
On Fri, Feb 18, 2011 at 4:19 PM, hekevintran <span dir="ltr"><<a href="mailto:hekevintran@gmail.com">hekevintran@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I am using RabbitMQ with Django through Celery. I am using the most<br>
basic setup:<br>
<br>
# RabbitMQ connection settings<br>
BROKER_HOST = 'localhost'<br>
BROKER_PORT = '5672'<br>
BROKER_USER = 'guest'<br>
BROKER_PASSWORD = 'guest'<br>
BROKER_VHOST = '/'<br>
<br>
I imported a Celery task and queued it to run one year later. From the<br>
iPython shell:<br>
<br>
In [1]: from apps.test_app.tasks import add<br>
<br>
In [2]: dt=datetime.datetime(2012, 2, 18, 10, 00)<br>
<br>
In [3]: add.apply_async((10, 6), eta=dt)<br>
DEBUG:amqplib:Start from server, version: 8.0, properties:<br>
{u'information': 'Licensed under the MPL. See <a href="http://www.rabbitmq.com/" target="_blank">http://www.rabbitmq.com/</a>',<br>
u'product': 'RabbitMQ', u'version': '2.2.0', u'copyright': 'Copyright<br>
(C) 2007-2010 LShift Ltd., Cohesive Financial Technologies LLC., and<br>
Rabbit Technologies Ltd.', u'platform': 'Erlang/OTP'}, mechanisms:<br>
['PLAIN', 'AMQPLAIN'], locales: ['en_US']<br>
DEBUG:amqplib:Open OK! known_hosts []<br>
DEBUG:amqplib:using channel_id: 1<br>
DEBUG:amqplib:Channel open<br>
DEBUG:amqplib:Closed channel #1<br>
Out[3]: <AsyncResult: cfc507a1-175f-438e-acea-8c989a120ab3><br>
<br>
RabbitMQ received this message in the celery queue:<br>
<br>
$ rabbitmqctl list_queues name messages durable<br>
Listing queues ...<br>
KTMacBook.local.celeryd.pidbox 0 false<br>
celery 1 true<br>
celeryctl_KTMacBook.local 0 true<br>
...done.<br>
<br>
I then killed RabbitMQ by hitting control-C followed by 'a' to abort.<br>
When I start the server again and check it with rabbitmqctl, it says<br>
that there are no messages in the celery queue:<br>
<br>
$ rabbitmqctl list_queues name messages durable<br>
Listing queues ...<br>
celery 0 true<br>
celeryctl_KTMacBook.local 0 true<br>
...done.<br>
<br>
The celery queue was durable. Why were the messages not persisted?<br>
What do I need to do to make the messages persistent?<br>
_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
</blockquote></div><br>