在 ttl 之后,死信消息不会重新排队到原始队列 [英] Dead-letterred messages not getting requeue to original queue after ttl

查看:32
本文介绍了在 ttl 之后,死信消息不会重新排队到原始队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我计划通过以下两个链接来延迟队列中消息的处理 link1 link2.所以,正如链接中所建议的那样.我已经用 x-dead-letter-exchangex-dead-letter-routing-key 参数声明了原始队列.当消息未能被消费者处理或 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.

RabbitMQ 中的死信死信消息

希望对你有帮助.

这篇关于在 ttl 之后,死信消息不会重新排队到原始队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆