简体   繁体   English

带有RabbitMq的Spring Amqp:从死信队列中掉下来后,消息没有被圈出回到实时队列

[英]Spring amqp with RabbitMq: Message is not circled back to live queue after falling off dead letter queue

I am trying to achieve this . 我正在努力实现这一目标 There are so many conflicting answers to know if its possible or not. 有太多相互矛盾的答案,以了解是否可能。

According to previous link, it is not possible. 根据先前的链接,这是不可能的。 But in another question on this forum, somebody remarked that they were able to here and in the comment section here . 但是,在这个论坛上另外一个问题,有人指出,他们能够在这里和在注释部分在这里

So, Is it possible to do live queue => dead-letter-queue => live queue 因此,是否可以进行实时队列=>死信队列=>实时队列

Or do I need to use a particular version of RabbitMq to achieve this ? 还是我需要使用特定版本的RabbitMq来实现这一目标?

I am able to do: live queue => dead-letter-queue and dead-letter-queue => live queue. 我能够做到:活动队列=>死信队列和死信队列=>活动队列。

You can't do it if the dead-lettering from alive is due to expiry - according to the documentation... 如果alive的死字母是由于到期而导致的,则无法执行此操作-根据文档...

It is possible to form a cycle of dead-letter queues. 可能形成死信队列的循环。 For instance, this can happen when a queue dead-letters messages to the default exchange without specifiying a dead-letter routing key. 例如,当队列将邮件死信到默认交换而不指定死信路由键时,可能会发生这种情况。 Messages in such cycles (ie messages that reach the same queue twice) will be dropped if the entire cycle is due to message expiry . 如果整个周期是由于消息到期,则将丢弃此类周期中的消息(即两次到达同一队列的消息)

(my emphasis). (我的重点)。

I just ran a test where the dead-lettering from alive is due to rejection and it works just fine; 我刚刚进行了一项测试,其中alive的死信是由于拒绝而造成的,并且工作得很好。 after a few cycles, the x-death header looks like this... 几个周期后, x-death标头看起来像这样...

reason: rejected
queue:  alive
time:   1419448981
exchange:   req
routing-keys:   alive

reason: expired
queue:  dead
time:   1419448981
exchange:   dlx
routing-keys:   alive

reason: rejected
queue:  alive
time:   1419448976
exchange:   req
routing-keys:   alive

reason: expired
queue:  dead
time:   1419448976
exchange:   dlx
routing-keys:   alive

...

To test this, I forced a failure in the Spring AMQP listener and set defaultRequeueRejected to false . 为了测试这一点,我在Spring AMQP侦听器中强制失败,并将defaultRequeueRejected设置为false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM