从JMeter检查ActiveMQ队列是否为空 [英] Checking ActiveMQ queue is empty from JMeter
问题描述
我正在使用JMeter对我们的应用程序进行性能测试,并且在ActiveMQ队列上以事件的形式进行了一些异步处理.我想等待ActiveMQ队列为空,然后再记录测试的统计信息.有什么好方法吗?
I am running a performance test using JMeter for our application and the there is some asynchronous processing in the form of events on an ActiveMQ queue. I want to wait for the ActiveMQ queue to be empty before recording the statistics for my test. Is there a good way to do that?
我已经在JMeter 2.10中探索了JMS生产者/消费者,但是它们消耗了队列外的消息,这不是我想要的,因为它修改了应用程序的原始流程.有没有一种方法可以在不消耗ActiveMQ消息的情况下监视队列的消耗?
I have explored the JMS Producer/Consumers in JMeter 2.10 but they consume messages off the queue which is not what I want as it modifies the original flow of the application. Is there a way to monitor the draining of the queue without consuming the messages of ActiveMQ?
我正在使用ActiveMQ 5.8和JMeter 2.10
I am using ActiveMQ 5.8 and JMeter 2.10
推荐答案
您可以使用MBean在该队列中获取挂起的消息.
"org.apache.activemq:BrokerName=host1,Type=Queue,Destination=dest1"
attribute: "QueueSize"
You can get the pending messages in that queue using the MBean
"org.apache.activemq:BrokerName=host1,Type=Queue,Destination=dest1"
attribute: "QueueSize"
每隔几秒钟检查一次并且该值不超过零后,您就可以开始记录统计信息了.
After checking once every few seconds and the value being not more than zero, you can start recording the statistics.
这篇关于从JMeter检查ActiveMQ队列是否为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!