Hi You can get all sorts of statistics from JMX about the routes. Such as timestamp from the last exchange.
On Thu, May 28, 2015 at 6:27 PM, s.marjanovic <[email protected]> wrote: > Hello, > > I have the following situation in the bundle I'm currently building: > > Route 1: from(entryTopic).to(targetQueue/bufferQueue) > This route sends the messages to targetQueue until a certain messageA comes > along. When that happens messages are routed either to targetQueue or to > bufferQueue depending on the type of messages. This is in effect until > messageB arrives and nullifies the effect of messageA and all the messages > are again routed straight to targetQueue. > > Route 2: from(bufferQueue).to(targetQueue) > This route routes the messages from bufferQueue to targetQueue while > messageA rule is not in effect in Route1. > > Route 3: from(quartz).to(targetQueue) > This route sends a sort of heartbeat message every minute to the > targetQueue, but also only when messageA rule is not in effect in Route 1. > > Implementation so far is based on controlbus component, with which Route2 > and Route3 are stopped when messageA arrives and started again when messageB > in Route1 arrives. Controlbus is invoked from Route1 once messageA or > messageB are recognized. > > Now, the requirements have changed a bit, and Route3 should not send a > message if there was traffic within the past minute in Route 1 or Route 2. > If there is at least 1min of inactivity in both Route1 and Route2, it should > start sending the heartbeat every minute till the traffic in Route 1 or > Route2 resumes. > > Is there a way to achieve this sort of reactivity from my Route3? Or perhaps > a different solution that would discard Route3 completely and focus on a > repeatable task that would monitor the first two routes and react when > needed? > > All the routes are under the same camel context/route builder. > > Camel version is 2.12.0.redhat-610379. > > > > -- > 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-tp5767607.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
