camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Problem in getting JMS queue attributes using MbeanServer.
Date Wed, 08 May 2013 11:26:11 GMT
Hi

You should use the user mailing list for questions about Apache Camel
as we say here
http://camel.apache.org/mailing-lists.html

And for the other stats then you need to grab them from the Apache
ActiveMQ broker. It has JMX MBeans as wel.
http://activemq.apache.org/jmx.html

On Wed, May 8, 2013 at 12:19 PM, loganathan <logu.it86@gmail.com> wrote:
> 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.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message