Persistence

13 views
Skip to first unread message

ceelian

unread,
Jul 29, 2009, 3:20:35 PM7/29/09
to carrot-users
Hi,

Is there a way to control the persistence options through Carrot like:

1. Mark the exchange “durable”.
2. Mark the queue “durable”.
3. Set the message’s “delivery mode” to a value of 2

Thank you.

Best Regards,
Christian

Ask Solem

unread,
Aug 11, 2009, 12:58:51 PM8/11/09
to carrot-users
Sorry for the late reply.

durable=True and delivery_mode=2 is the default configuration in
Carrot.

To change it you can change the durable attribute on the Publisher
+Consumer
and the delivery_mode attribute on the Publisher.

>>> consumer = Consumer(connection=conn, queue="myqueue", exchange="foo",
... routing_key="foo", durable=False)
>>> publisher = Publisher(connection=conn, exchange="foo", routing_key="foo",
durable=True, delivery_mode=0)

Christian Haintz

unread,
Aug 11, 2009, 1:01:46 PM8/11/09
to carrot...@googlegroups.com

On Aug 11, 2009, at 6:58 PM, Ask Solem wrote:
> On Jul 29, 9:20 pm, ceelian <christian.hai...@gmail.com> wrote:
>> Hi,
>>
>> Is there a way to control the persistence options through Carrot
>> like:
>>
>> 1. Mark the exchange “durable”.
>> 2. Mark the queue “durable”.
>> 3. Set the message’s “delivery mode” to a value of 2
>>
>> Thank you.
>>
>> Best Regards,
>> Christian
>
> Sorry for the late reply.

No Problem.

>
> durable=True and delivery_mode=2 is the default configuration in
> Carrot.
>
> To change it you can change the durable attribute on the Publisher
> +Consumer
> and the delivery_mode attribute on the Publisher.
>
>>>> consumer = Consumer(connection=conn, queue="myqueue",
>>>> exchange="foo",
> ... routing_key="foo", durable=False)
>>>> publisher = Publisher(connection=conn, exchange="foo",
>>>> routing_key="foo",
> durable=True, delivery_mode=0)

Great. Thank you!

cheers,
Christian

Reply all
Reply to author
Forward
0 new messages