[jboss-user] [JBoss Messaging] - MessageCounter can't get total message count

ienvyou do-not-reply at jboss.com
Wed Oct 29 03:40:57 EDT 2008


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();
  | 

The problem is that queueMBean.getMessageCounter().getCount() method always return 0, even though I sent a lot of message to target queue.

Is it bug? or not implement? 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4185284#4185284

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4185284



More information about the jboss-user mailing list