Cycling deadletter behavior

211 views
Skip to first unread message

nicolas esclapez

unread,
Oct 6, 2016, 4:19:35 AM10/6/16
to rabbitmq-users
Hi, 

I am working on a base RabbitMQ app where messages can't be loose.
All incoming messages must be Validate, Cancelled for retry later (noAck) or definitely rejected (moved to a trash queue)


The configuration : 

I have 2 exchanges : 'secondary.direct', 'cancel.fanout' and 2 queues : 'ProductBaseCheck.0' and '_delayed' with a TTL value

The binding :
- secondary.direct --> ProductBaseCheck.0 (with rootkey)
- cancel.fanout --> _delayed

Each queue have a dead letter exchange :
- ProductBaseCheck.0 (DLX)--> cancel.fanout
- _delayed (DLX)--> secondary.direct

Case 1 :
- A message is published on secondary.direct --> it is moved to the ProductBaseCheck.0 queue 
- The ttl expires -->  it is moved to _delayed queue
- The ttl expires again --> the message is detroyed by Rabbit MQ (see log below)

> =WARNING REPORT==== 5-Oct-2016::18:36:56 ===
Message dropped. Dead-letter queues cycle detected: [<<"ProductBaseCheck.0">>,
>                                                      <<"_delayed">>,
>                                                      <<"ProductBaseCheck.0">>]
> This cycle will NOT be reported again.

Case 2 :
- A message is published on secondary.direct --> it is moved to the ProductBaseCheck.0 queue and waiting for consume
- The consumer cancel the message (noack) --> it is moved to _delayed queue
- The ttl expires --> the message is move to the ProductBaseCheck.0 queue and can cycle indefinitely (see the message dump below, after many cycles)

Exchange secondary.direct
Routing Key ProductBaseCheck.0
Redelivered ?
Properties
..timestamp: 1475691989728
..priority: 0
..delivery_mode: 2
..headers:
....item-retry-count: 0
....x-death: count: 6
....exchange: cancel.fanout
....queue: _delayed
....reason: expired
....routing-keys: ProductBaseCheck.0
....time: 1475684807

count: 1
reason: rejected
queue: ProductBaseCheck.0
time: 1475684792
exchange: primary.fanout
routing-keys: ProductBaseCheck.0

count: 5
exchange: secondary.direct
queue: ProductBaseCheck.0
reason: expired
routing-keys: ProductBaseCheck.0
time: 1475684837
content_type: text/plain; charset=utf-8
Payload 32 bytes Encoding: string {"Id":12,"Name":"toBeCancelled"}


Questions :

- It is possible to disabled cycle detection (case 1) ?

- Is the cycling behavior (case 2) will be fixed on a future version ?

Thanks

Best Regards

Nicolas Esclapez





Michael Klishin

unread,
Oct 6, 2016, 4:38:55 AM10/6/16
to rabbitm...@googlegroups.com
You cannot disable cycle checking and it uses pairs of {queue, dead-lettering reason} to identify unique events.
So if it is dead-lettered for two different reasons, they are not counted as the same thing. Other than that we are not aware of
any cases when cycle detection does not work as expected.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ
Reply all
Reply to author
Forward
0 new messages