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