ActiveMQ 获取入队/出队计数 [英] ActiveMQ Getting Enqueue/Dequeue Count

查看:51
本文介绍了ActiveMQ 获取入队/出队计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在DEBUG模式下,有一个ActiveMQ日志为

In DEBUG mode, there is an ActiveMQ log as

09:44:10,666 [ActiveMQ Task-1] DEBUG  org.apache.activemq.broker.region.Queue:1687 - queue.demo toPageIn: 0, Inflight: 0, pagedInMessages.size 3, enqueueCount: 10, dequeueCount: 7

是否可以在我的 Java 代码中获取相同的数据以获取 enqueueCount 和 dequeueCount?

Is it possible that I can get same data inside of my Java code to get enqueueCount and dequeueCount?

谢谢.

ps.我试过 StatisticsPlugin 但我想我不能使用它,因为这个问题中提到的异步模式 ActiveMQ 异步统计接收

ps. I've tried StatisticsPlugin but I guess I cannot use it because of async mode as mentioned in this question ActiveMQ async statistics receving

推荐答案

是的,当然可以.ActiveMQ 通过 JMX 公开了很多特性和数据.

Yes, of course you can. ActiveMQ exposes a lot of features and data through JMX.

查看 ActiveMQ JMX 文档 页面.要了解界面,请使用jconsole"浏览 MBean 并查看您可能需要哪些方法和属性(上一个链接几乎用屏幕截图说明了您的问题).

Look at the ActiveMQ JMX docs page. To get a feeling for the interface, use "jconsole" to browse through the MBeans and see what methods and attributs you might need (the previous link pretty much nails your question with a screenshot).

JMX 很容易通过 java 访问,所以只需开始编码.一些起点.

JMX is easily accessible via java, so just start coding. Some starting points.

这篇关于ActiveMQ 获取入队/出队计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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