如果使用者未确认消息,ActiveMQ将停止向队列使用者发送消息 [英] ActiveMQ stops sending messages to Queue Consumer in case of consumer not acknowledging messages

查看:201
本文介绍了如果使用者未确认消息,ActiveMQ将停止向队列使用者发送消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个用例,其中我们仅创建一个使用者来处理队列中的消息.消息处理器在确认之前累积一定数量的消息.以异步方式并使用事务处理会话来接收消息.邮件的大小很小.

We have a use case wherein we create just one consumer to process messages in the Queue. Message processor accumulates certain number of messages before acknowledging. Receiving messages in Asynchronous way and using Transacted session. Size of message is very small.

Active MQ在一定数量的消息后停止向唯一的使用者发送其他消息,并等待确认.我们尝试了 consumer.prefetchSize consumer.maximumPendingMessageLimit 之类的解决方案;但没有任何效果. 我们在只有一个订阅者的情况下尝试了具有持久主题的类似用例,并且效果很好.

Active MQ stops sending further messages to sole consumer after certain number of messages and waits for acknowledgement. We have tried solutions like consumer.prefetchSize, consumer.maximumPendingMessageLimit; but nothing is working. We tried similar use case with a durable topic with just one subscriber and it works fine.

有人遇到过类似的activemq问题/行为吗?我们尝试了在不同论坛上提到的许多事情,但是没有一个帮助.

Has anyone encountered similar activemq issue/behavior? We tried many things mentioned on different forums but none of them helped.

Activemq版本: ActiveMQ 5.6.0
队列配置:持久队列
使用者:异步,并使用交易的会话作为确认模式

Activemq version : ActiveMQ 5.6.0
Queue configuration : Durable queue
Consumer : Asynchronous and uses transacted session as acknowledgement mode

任何帮助或建议将不胜感激.谢谢.

Any help or suggestion will be greatly appreciated. Thanks.

推荐答案

我尝试了许多不同的配置,通过设置不同的activemq属性(例如预取策略,maxpagesize等)来解决此问题,但是它们都没有真正的帮助.通过引用 @Jake的注释,我了解了有关通过以下方式使用JMX监视activemq的信息: JConsole .这是一个非常方便的工具,可以监视和管理您的activemq. 以下是一些您可能会觉得有用的文章.
1. 监视activemq
2. 连接使用JConsole的activemq JMX

I had tried out lot of different configurations to resolve this issue by setting different activemq attributes like prefetch policy, maxpagesize etc. but none of them really helped. By referring to @Jake's comment I got to know about monitoring activemq using JMX via JConsole. This is a very handy tool to monitor and manage your activemq. Here are few article which you may find useful.
1. Monitoring activemq
2. Connecting activemq JMX using JConsole

通过监视队列属性,我发现 memoryLimit 属性具有非常低的分配值(仅为1mb).增加属性的值解决了我的问题. JMS开始发送消息,而无需等待确认.

By monitoring the queue attributes I figured out that memoryLimit attribute had very low value assigned to it (just 1mb). Increasing the value of the attribute solved my issue. JMS started sending messages without waiting for acknowledgement.

出于测试目的,我在conf/activemq.xml配置文件中更改了 memoryLimit 的值.

For testing purpose I had changed the value for memoryLimit in the conf/activemq.xml configuration file.

这篇关于如果使用者未确认消息,ActiveMQ将停止向队列使用者发送消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆