Activemq我遇到了一个问, 就是mq部署到外网linux时, 我的消费者用的是messageListener, 可是过半个小时左右, 我在发消息的时候, 消费者就是接收不到了, 而且过一会就会发现mq管理页面发现消费者和mq断开连接, 这是什么原因呢?
问题一直困扰了我好久,最近突然找到了原因,记录一下
首先看一下官方文档
ActiveMQ InactivityMonitor
The ActiveMQ InactivityMonitor is an active thread that checks the connection is still active and if it suspects the connection is not functioning correctly, it closes the connection.
Connections are monitored by:
- Ensuring data is read from the connection during the specified time period (Max Inactivity Duration).
- Writing a
KeepAliveInfo
message to the connection if no normal activemq traffic is sent across the connection during the specified time period.
Each connection has two InactivityMonitors associated, one on each end of the connection. The InactivityMonitor expects to receive data on the connection during a specified time period. If normalActiveMQ traffic has not been sent across the connection during that period, it expects to receive a KeepAliveInfo
message sent by the InactivityMonitor on the other end of the connection.
Using the default values; if no data has been written or read from the conne