死信后的消息不会在ttl之后重新排队到原始队列 [英] Dead-letterred messages not getting requeue to original queue after ttl
问题描述
我计划通过跟踪这两个链接来延迟队列中消息的处理链接2 .因此,如链接中所建议.我用x-dead-letter-exchange
和x-dead-letter-routing-key
args声明了原始队列.当消息无法被使用者或ttl处理或发生队列长度超出时,它将消息发布到所谓的dead-letter-queue
.现在,在dead-letter-queue
中,已将类似的args与ttl
参数一起设置.假定在ttl
超过后将消息重新发布到原始队列.但问题在于它正在丢弃所有消息.
I have planned to delay the processing of messages in queue by following these two links link1 link2. So, as suggested in the link. I have declared the original queue with the x-dead-letter-exchange
and x-dead-letter-routing-key
args. Which published the messages to the so called dead-letter-queue
when message either failed to get processed by consumer or ttl happen or queue length exceed. Now in the dead-letter-queue
similar args have been set along with the ttl
parameter. Which is suppose to republish the messages to the original queue after ttl
exceed. But the problem is it is dropping all the messages.
此外,这里还有一个陷阱.如果我明确地将失败的消息从原始队列发布到死信队列.然后,在ttl之后,它将消息重新发布到原始队列.为什么会这样,以及我如何使其工作.这样,死信队列会将消息重新发布到原始队列,而不是丢弃.我正在使用RabbitMQ 3.0.0
.
Moreover, there is a catch here. If i explicitly publish the failed messages from original queue to dead-letter-queue. Then after ttl it republish the messages to the original queue. Why is it so and how do i make it work. So that dead-letter-queue republishes the messages to the original queue instead of dropping. I am using RabbitMQ 3.0.0
.
仅供参考,我同时创建了direct
类型的交换和路由密钥
FYI, I have created both the exchanges of direct
type along with the routing key
推荐答案
当队列具有TTL设置时,这意味着该队列中的消息将在队列结束后发送到与该队列关联的死信交换(DLX). TTL已过期.如果队列没有分配DLX,则消息进入位存储桶.
When a queue has a TTL setup that means that messages in that queue will be sent to the dead-letter-exchange (DLX) associated with that queue after the TTL has expired. If the queue has no DLX assigned then the messages go into the bit bucket.
如果您想将消息发送回队列中进行重新处理,则需要进行本文中所述的设置.
If you want to send messages back into the queue from which they came to be re-processed then you need to have the setup that I described in this post.
希望这对您有所帮助.
这篇关于死信后的消息不会在ttl之后重新排队到原始队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!