[rabbitmq-discuss] dead-letter-exchange behaviour

cogitate monish.unni at gmail.com
Thu Aug 2 20:13:44 BST 2012


mathias : 
Totally indebted to you! Thank you Much!
That works like a gem! 

just a note:
  when the server received messages ( with default prefetch) and 10 messages
were dispatched from the client, the management console displayed "10 Unackd
and 10 Total" on the server queue. this confused me because, if it's in the
server queue why doesn't rabbit honor the x-message-ttl of the queue? 
this was not very clear in the "Fair Dispatch" section. 

Thanks for throwing the *light*!
kind regards,
-monish


Matthias Radestock-3 wrote
> 
> Monish,
> 
> On 01/08/12 17:00, cogitate wrote:
>> i am trying to get dead-letter-exchange work..
>>   steps below:
>> [0] s2.direct is an exchange that declares a dead-letter-exchange(DLE)
>> called s2.dlx ( rabbitmq )
>> [1] setup DLE consumer -  declares a DLQ (pyDlxQueue) binds to
>> DLE(s2.dlx)
>> [2] setup a consumer listening to queue (EchoPayMe) binds to
>> s2.direct(exchange)
>>      queue EchoPayMe setup with arguments x-message-ttl=10 and DLE=s2.dlx
>>      the consumer also sleeps for 100 seconds ( to simulate
>> long-running/hanging service)
>>      the idea is a producer puts 10 messages in it's queue will only have
>> message 1 served,
>>      the rest of the messages should go to DLE(s2.dlx) when the DLE
>> consumer
>> replies.
>> [3] the producer - publish messages to s2.direct exchange w/
>> rk="EchoPayMe"
>>
>> the problem is no messages are received by the DLQ or get routed to the
>> DLE
>> consumer.
>> the code for the DLE consumer, App consumer and App Producer in
>> python/pika
>> below.
> 
> ok.
> 
>> i am sure there's a fundamental error in what i am doing
> 
> yep.
> 
>> --  Consumer ---
>> [...]
>> #channel.basic_qos(prefetch_count=1)
> 
> Try uncommenting that. Without a prefetch set, the broker will happily 
> send all messages straight to the consumer as soon as they enter the 
> queue, as explained in the "Fair dispatch" section of 
> http://www.rabbitmq.com/tutorials/tutorial-two-python.html. If the 
> client is busy then he messages will be buffered in the network / the 
> client, but as far as the broker is concerned they have been delivered 
> straight away and so won't be expired & dead-lettered.
> 
> Regards,
> 
> Matthias.
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at .rabbitmq
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> 



--
View this message in context: http://rabbitmq.1065348.n5.nabble.com/dead-letter-exchange-behaviour-tp21167p21211.html
Sent from the RabbitMQ mailing list archive at Nabble.com.


More information about the rabbitmq-discuss mailing list