Ashwin maybe its just a matter of in the source code in CronScheduledRoutePolicy to implement the onInit method and "compute" if the route should be in started/stopped state, and react accordingly.
Then people can configure the route as autoStarted=false. But the route policy, would start it automatic if it should (eg within the opening hours). The problem could be if people dont have autoStarted=false, then the route would be started by Camel always. On Tue, Jul 5, 2011 at 11:06 PM, Ashwin Karpe <[email protected]> wrote: > Hi, > > I understand your requirement, however the CronScheduledRoutePolicy is > designed to fire in the following way. > > - It fires at 10 am. It can then start a route if it has not been > started or else do nothing > - It then fires again at 4 pm. It can then stop a route if it has not > already been stopped. > > Since it is a "Cron" event, the policy is not designed to poll or inspect > system time periodically to figure out whether is between 10 am and 4 p.m to > do the needful. This model is expensive in general and can limit performance > due to constant checking/polling on what needs to happen based on what time > it is. > > If this is something you absolutely need then I would recommend doing > something like what I have done below. This should fire an event every 5 > seconds and your RouteStartStopBean should wake up and do the starting and > stopping of the routes you care about based on the system time. > > from ("quartz://myGroup/myTimerName?cron=0/5+*+*+*+*+?$") > .to("bean:myRouteStartStopBean); > > Hope this helps. > > Cheers, > > Ashwin... > > ----- > --------------------------------------------------------- > Ashwin Karpe > Apache Camel Committer & Sr Principal Consultant > FUSESource (a Progress Software Corporation subsidiary) > http://fusesource.com > > Blog: http://opensourceknowledge.blogspot.com > --------------------------------------------------------- > -- > View this message in context: > http://camel.465427.n5.nabble.com/CronScheduledRoutePolicy-tp4552324p4554769.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
