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

查看:170
本文介绍了死信后的消息不会在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天全站免登陆