camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TRACK81 <hmu...@gmail.com>
Subject How to Get MBean statistics For a Route, E.g. LastExchangeCompletedTimestamp
Date Wed, 07 Apr 2010 11:42:31 GMT

Hi,

I am fairly new to Camel and strugling to 

get the statistic LastExchangeCompletedTimestamp for a "specific" route.

I can get the statistic by using the getRoutes().get(2) using the following
code:

-----------------------------------------------------------------------------------------
List<Route> r = camelContext.getRoutes();
		
System.out.println("r side: " + r.size());
System.out.println("r side: " + r.get(2).getId());
		
ObjectName obj =
camelContext.getManagementStrategy().getManagementNamingStrategy().getObjectNameForRoute(r.get(2));
Object o6 = 

camelContext.getManagementStrategy().getManagementAgent().getMBeanServer().invoke(obj,
"getLastExchangeCompletedTimestamp", null, null);

if(o6 != null)
System.out.println("Last Exchange Timestamp is : " + ((Date)o6));

Which prints out:

Last Exchange Timestamp is : Wed Apr 07 13:38:40 CEST 2010
-----------------------------------------------------------------------------------------

What i would like is to get a specific Route using its name as a qualifier,
something like
Route r = camelContext.getRoutes().get("MyRoute");

But this is not possible, could you please help me with any suggestions...??

Best regards in Advance

TRACK81
-- 
View this message in context: http://old.nabble.com/How-to-Get-MBean-statistics-For-a-Route%2C-E.g.-LastExchangeCompletedTimestamp-tp28163769p28163769.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message