camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Posta <christian.po...@gmail.com>
Subject Re: API to determine the last time a route was successfully executed
Date Thu, 17 Oct 2013 15:55:20 GMT
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 <saltnlight5@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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message