[rabbitmq-discuss] losing messages

Simon MacMullen simon at rabbitmq.com
Wed Sep 11 16:14:07 BST 2013


If you declare a queue as auto-delete, it will delete itself when the 
last consumer disconnects.

If you declare an exchange as auto-delete, it will delete itself when 
the last queue unbinds (possibly as the result of a queue 
auto-deleting). Even if publishers are publishing to it!

Publishers which are publishing at that point will have their channels 
closed for publishing to an exchange which does not exist. If you have 
some retry logic in your publisher client you might then find that the 
publishers are reconnecting and redeclaring everything.

You probably want to stop declaring your exchanges (at least) as 
auto-delete. I doubt it's helping and it sounds like it's causing 
significant problems. In general auto-delete exchanges are a rare thing 
to want to use (they are mostly useful with internal exchanges and 
exchange to exchange bindings).

You might also want to turn on publisher confirms. See 
http://www.rabbitmq.com/confirms.html and 
http://www.rabbitmq.com/reliability.html

Cheers, Simon

On 11/09/13 16:02, Grenier,Michel [CMC] wrote:
> More details about message leaking
>
> My publishers all open one connection, uses 1 channel and declare and
> feed the same exchange (exchange with auto-delete = true)
>
> When I start the publishers the exchange is created and receives
> (publish-in) messages.
>
> Than running my consumer :
> it opens one connection, uses 1 channel, creates a queue
> (auto-delete=true) and declare the same exchange (auto-delete=true)
>   and bind the exchange  to its queue
> everything runs smoothly.
>
> When I stop my consumer the exchange is deleted in the rabbitmq server
> (rabbitmq-management shows that)
> even if the publishers are still feeding ???   Is this normal ?
>
> Restarting the consumer, the exchange is "recreated"  but it seems that
> some (or sometimes all) the bindings with the publishers
> are broken ???
>
> This is how I am losing messages
>
> Rabbitmq 3.1.5
>
>
> What do I do wrong ?
>
>
> 		Michel Grenier
> 		(514) 421-7204
>
>
> -----Original Message-----
> From: rabbitmq-discuss-bounces at lists.rabbitmq.com
> [mailto:rabbitmq-discuss-bounces at lists.rabbitmq.com] On Behalf Of
> Grenier,Michel [CMC]
> Sent: 09 September, 2013 10:51
> To: Discussions about RabbitMQ
> Subject: Re: [rabbitmq-discuss] losing messages
>
> No error on the producer/publisher side
> No errors/warnings in  RabbitMQ log.
>
> I have installed PIKA, and used their asynchronous consumer example and
> so far (over the all the weekend) I wasn't able to reproduce the
> problem...
>
> This seems to point to my consumer...  will post something if it happens
> again.
>
> Thanks
>
> 		Michel Grenier
> 		(514) 421-7204
>
>
>
> -----Original Message-----
> From: rabbitmq-discuss-bounces at lists.rabbitmq.com
> [mailto:rabbitmq-discuss-bounces at lists.rabbitmq.com] On Behalf Of
> Michael Klishin
> Sent: 05 September, 2013 11:19
> To: Discussions about RabbitMQ
> Subject: Re: [rabbitmq-discuss] losing messages
>
> Grenier,Michel:
>
>> than  for no apparent reason,  my consumer is missing  some messages
>> from one producer...
>>
>>     The producer still sends messages...   I simply restart the
> producer and the problem is resolved...
>
> Is your producer report any errors? Are there any errors or warnings in
> RabbitMQ log (if you have it, please post it to the list).
>
> Does it work better if you try Pika (a different Python client)?
>
> MK
>
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>


-- 
Simon MacMullen
RabbitMQ, Pivotal


More information about the rabbitmq-discuss mailing list