camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "s.marjanovic" <slavisa.marjanovic...@gmail.com>
Subject Re: How to react when there is a fixed period of inactivity (no traffic) in a route?
Date Mon, 01 Jun 2015 10:26:35 GMT
Hi,

I managed to get around the problem by using the statistics about the last
completed exchange and the elapsed time since last reset like this:

Date lastCompletedExchangeTimestamp = (Date)
camelContext.getManagementStrategy().getManagementAgent().getMBeanServer()
                                                            
.invoke(objectNameForRoute, "getLastExchangeCompletedTimestamp", null,
null);

Date resetTimestamp = (Date)
camelContext.getManagementStrategy().getManagementAgent().getMBeanServer()
                                               .invoke(objectNameForRoute,
"getResetTimestamp", null, null);

One small question though, I'm assuming that getResetTimestamp will give me
the time that camel context was initialized or the time of the last reset of
statistics (which doesn't concern me for now since statistics aren't being
reset manually yet).

Am I right with my assumption? Is there anything better to replace
getResetTimestamp with? I'm interested in obtaining camel context
initialization timestamp here and haven't had luck finding an alternative to
getResetTimestamp.

Thanks



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-react-when-there-is-a-fixed-period-of-inactivity-no-traffic-in-a-route-tp5767607p5767731.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message