ActiveMq -Rejecting received message_JAVA_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > JAVA > ActiveMq -Rejecting received message

ActiveMq -Rejecting received message

 2014/10/9 18:52:01  quentinXXZ  程序员俱乐部  我要评论(0)
  • 摘要:链接地址http://quentinXXZ.iteye.com/blog/2126684ActiveMq在stop操作,停止接收时,出现如下提示:2014-09-2320:26:23,233WARN[ActiveMQSessionTask-1](AbstractMessageListenerContainer.java:461)-Rejectingreceivedmessagebecauseofthelistenercontainerhavingbeenstoppedinthemeantime
  • 标签:

? ??

?链接地址http://quentinXXZ.iteye.com/blog/2126684

?

? ? ActiveMq在stop操作,停止接收时,出现如下提示:

2014-09-23 20:26:23,233 ?WARN [ActiveMQ Session Task-1] (AbstractMessageListenerContainer.java:461) - Rejecting received message because of the listener container having been stopped in the meantime: ActiveMQTextMessage ....

? ? ?我开始怀疑是否存在消息丢失。

? ? ?经查询,做如下修改,将acceptMessageWhileStopping从false改为true就不再出现上述提示。对应的方法名为setAcceptMessagesWhileStop()

?官方说明如下:

?

Set whether to accept received messages while the listener container in the process of stopping.

Default is "false", rejecting such messages through aborting the receive attempt. Switch this flag on to fully process such messages even in the stopping phase, with the drawback that even newly sent messages might still get processed (if coming in before all receive timeouts have expired).

NOTE:?Aborting receive attempts for such incoming messages might lead to the provider's retry count decreasing for the affected messages. If you have a high number of concurrent consumers, make sure that the number of retries is higher than the number of consumers, to be on the safe side for all potential stopping scenarios.

?

?

上述说明,仍无法确认是否真正的存在消息丢失。

后来做了下实验,将只开发送端,接收端不开,在Broker持久化一定量消息,再关闭发送端。acceptMessageWhileStopping设为false。启动接收端,并在其统计接收count,再做stop,出现上述的warn信息。再与activemq监控页面的count数据进行加减,对比,发现确实存在消息丢现象(当然也有可能跟具体的环境与代码有关)。

?

  • class='magplus' title='点击查看原始大小图片' />
  • 大小: 33.6 KB
  • 查看图片附件
  • 相关文章
发表评论
用户名: 匿名