zoukankan      html  css  js  c++  java
  • 没有连接的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






  • 相关阅读:
    一个Java对象到底占用多大内存
    Java 动态代理机制分析及扩展
    JVM内幕:Java虚拟机详解
    深度分析 Java 的 ClassLoader 机制(源码级别)
    Java异常的深入研究与分析
    HashMap的工作原理
    Java枚举常见7种用法
    left join 过滤条件写在on后面和写在where 后面的区别
    mysql left( right ) join使用on 与where 筛选的差异
    SQL索引优化
  • 原文地址:https://www.cnblogs.com/softidea/p/12275556.html
Copyright © 2011-2022 走看看