For getting monitoring related stuffs in camel for a route i had added the
following codes

ObjectName objName = new ObjectName("org.apache.camel:type=routes,*");
MBeanServer mbeanServer =
camelContext.getManagementStrategy().getManagementAgent().getMBeanServer();
List<ObjectName> cacheList = new LinkedList(mbeanServer.queryNames(objName,
null));
for (Iterator<ObjectName> iter = cacheList.iterator(); iter.hasNext();)
                        {
                            objName = iter.next();
                            String keyProps = 
objName.getCanonicalKeyPropertyListString();
                            ObjectName objectInfoName = new 
ObjectName("org.apache.camel:" +
keyProps);
                            String routeId = (String) 
mbeanServer.getAttribute(objectInfoName,
"RouteId");
                            String description = (String)
mbeanServer.getAttribute(objectInfoName, "Description");
                            String state = (String) 
mbeanServer.getAttribute(objectInfoName,
"State");
                            String endpointurl = (String)
mbeanServer.getAttribute(objectInfoName, "EndpointUri");
                            System.out.println("routeId========"+ routeId);
                            System.out.println("description========"+ 
description);
                            System.out.println("state========"+ state);
                            System.out.println("endpointurl========"+ 
endpointurl);
                            System.out.println("exchangesCompleted========"+
mbeanServer.getAttribute(objectInfoName, "ExchangesCompleted"));
                            System.out.println("exchangesFailed========"+
mbeanServer.getAttribute(objectInfoName, "ExchangesFailed"));
                            System.out.println("exchangesTotal========"+
mbeanServer.getAttribute(objectInfoName, "ExchangesTotal"));
                        }

The above code giving proper results for route related monitoring things in
camel.

But I need to get jms queue statistics such as queuesize,name,Total number
of messages in jms queue.

I am using camel 2.9.2 and activemq 5.7,I don't know exactly what are all
the attributes have to use from mbeanServer object.

can anyone help me to get jms queue statistics(monitoring) as like above
route staistics(monitoring) very urgent.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-in-getting-JMS-queue-attributes-using-MbeanServer-tp5732173.html
Sent from the Camel Development mailing list archive at Nabble.com.

Reply via email to