没有连接的AMQP / RabbitMQ通道何时死亡?(when does an AMQP/RabbitMQ channel with no connections die?)

Posted 沧海一滴

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了没有连接的AMQP / RabbitMQ通道何时死亡?(when does an AMQP/RabbitMQ channel with no connections die?)相关的知识,希望对你有一定的参考价值。

 

I have a simple RabbitMQ test program randomly enqueuing messages, and another reading them, all using Spring-AMQP. If the consumer dies (for example killing a process without having a chance to close its connection or channel), any messages that it had not acknowledged appear to remain unacknowledged forever.

I have seen a number of references (for example this question) that say that the channel dies when it has no connections, and that remaining unack‘d messages will be redelivered. That‘s not the behaviour I see - instead I get a growing list of channels marked IDLE and a growing list of connections marked running but with no activity.

Is there some configuration required to notice that connections are dead once the process has been killed?

EDIT: I was running the rabbitmq server inside a VirtualBox VM, which apparently doesn‘t manage dead inbound connections correctly over NAT. This works just fine with the mq server running directly on the physical host.

解决方案

Answering to close. This turns out not to be a real issue.

I was running the rabbitmq server inside a VirtualBox VM, which apparently doesn‘t manage dead inbound connections correctly over NAT. This works just fine with the mq server running directly on the physical host.

问 题

我有一个简单的RabbitMQ测试程序随机排队消息,另一个读取它们,都使用Spring-AMQP。如果消费者死亡(例如,在没有机会关闭其连接或通道的情况下终止进程),则任何未确认的消息似乎永远不会被确认。

我已经看到一些参考文献(例如这个问题),表示该频道在没有连接时会死亡,剩下的就是unack‘d消息将被重新传递。这不是我看到的行为 - 相反,我得到了一个越??来越多的标记IDLE的频道列表,以及越来越多的标记正在运行但没有活动的连接列表。

是否需要一些配置注意一旦进程被杀死,连接就已经死了?

编辑:
我在VirtualBox中运行了rabbitmq服务器VM,显然无法通过NAT正确管理死入站连接。这对于直接在物理主机上运行的mq服务器来说效果很好。

解决方案

回答关闭。事实证明这不是一个真正的问题。

我在VirtualBox VM中运行rabbitmq服务器,显然无法通过NAT正确管理死入站连接。这对于直接在物理主机上运行的mq服务器来说效果很好。

http://www.it1352.com/987062.html






以上是关于没有连接的AMQP / RabbitMQ通道何时死亡?(when does an AMQP/RabbitMQ channel with no connections die?)的主要内容,如果未能解决你的问题,请参考以下文章

如何从我的连接自己的通道以外的其他通道恢复未确认的 AMQP 消息?

RabbitMq Acks / 重新发布

RabbitMQ学习

世上最全的RabbitMQ-总结

连接rabbitmq,芹菜和django时出现通道错误

非常强悍的 RabbitMQ 总结,写得真好!