actviemq 使用过程中碰到的问题

activemq 使用中碰到的两个问题:

[b]#1.重启activemq,没有重启生产者消费者应用,导致消息法务发生和接收。[/b]

搜索结果建议把联系的串改成:failover:(tcp://127.0.0.1:61616) 。使用断线重连机制。具体就是使用failover方式,使得连接断开之后,可以不断的重试连接到一个或多个brokerURL。

[b]#2.重启了生产者,但是时间比较久,发现消费者无法消费消息。[/b]

看到log:

| INFO | Transport failed: org.apache.activemq.transport.InactivityIOException: Channel was inactive for too (>30000) long: /192.XX.X.XX:60286 | org.apache.activemq.broker.TransportConnection.Transport | InactivityMonitor Async Task: java.util.concurrent.ThreadPoolExecutor$Worker@4384111f[State = -1, empty queue]

官方说法:

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.

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 normal activemq 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.


应该是activemq,每一个连接会有2个InactivityMonitor监控,如果没有收到正常的数据,另一个会发送KeepAliveInfo信息来确保连接正常 ,如果指定时间都没有收到,会自动关闭连接

http://activemq.apache.org/activemq-inactivitymonitor.html
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值