You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by gilboy <jo...@gmail.com> on 2013/10/16 17:58:52 UTC

API to determine the last time a route was successfully executed

Hi

If I hook up a JMX console to my camel application I can see a number of
MBeans which expose information like the last time a route was successfully
executed.

Can I get this same information from the camelContext, Route, RouteContext
etc. I can't appear to find a similar method which I can call from within my
application to get this information.

Thanks
Joe



--
View this message in context: http://camel.465427.n5.nabble.com/API-to-determine-the-last-time-a-route-was-successfully-executed-tp5741686.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: API to determine the last time a route was successfully executed

Posted by Christian Posta <ch...@gmail.com>.
Zemian is correct.

Try something like this out...

MBeanServer server =
context.getManagementStrategy().getManagementAgent().getMBeanServer();

ObjectName routeName =
ObjectName.getInstance("org.apache.camel:context=localhost/camel-1,type=routes,name=\"route1\"");

Date lastCompleted = (Date) mbeanServer.getAttribute(routeName,
"LastExchangeCompletedTimestamp");



On Wed, Oct 16, 2013 at 7:42 PM, saltnlight5 <sa...@gmail.com> wrote:

> Hi,
>
> Camel can expose itself onto a MBeanServer, and that's how you see them in
> jconsole. You can get to the MBeanServer through
> camelContext.getManagementStrategy().getManagementAgent().getMBeanServer().
> Once you have that, you can use the standard MBeanServer API to query any
> of
> those mbean you see in jconsole with its ObjectName.
>
> --
> Zemian
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/API-to-determine-the-last-time-a-route-was-successfully-executed-tp5741686p5741720.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Re: API to determine the last time a route was successfully executed

Posted by saltnlight5 <sa...@gmail.com>.
Hi,

Camel can expose itself onto a MBeanServer, and that's how you see them in
jconsole. You can get to the MBeanServer through
camelContext.getManagementStrategy().getManagementAgent().getMBeanServer().
Once you have that, you can use the standard MBeanServer API to query any of
those mbean you see in jconsole with its ObjectName.

--
Zemian



--
View this message in context: http://camel.465427.n5.nabble.com/API-to-determine-the-last-time-a-route-was-successfully-executed-tp5741686p5741720.html
Sent from the Camel - Users mailing list archive at Nabble.com.