Hello,
I am making a queue real-time graph for monitoring JBoss messaging Queue/Topic.
JDK : JDK1.5.0_14
JBM : JBoss Messaging 1.4.0 SP02
I tried to connect jmx as like this :
RMIAdaptor server = (RMIAdaptor) ctx
.lookup("jmx/invoker/RMIAdaptor");
// Get the MBeanInfo for the JNDIView MBean
String targetName = "jboss.messaging.destination:service=" + type + ",name=" + name;
ObjectName objName = ObjectName
.getInstance(targetName);
System.out.println(objName);
if (type.equalsIgnoreCase(QUEUE)) {
QueueMBean queueMBean = (QueueMBean) MBeanServerInvocationHandler
.newProxyInstance(server, objName,
QueueMBean.class, false);
currentMessageCount = queueMBean.getMessageCount();
totalMessageCount = queueMBean.getMessageCounter().getCount();
Have you turned on message counters?
Read the manual for more info.