On Tue, Oct 26, 2010 at 6:04 PM, Ashwin Karpe <aka...@fusesource.com> wrote: > > Hi, > > In your particular case the route would look something like the following if > you adopted the scheduled route policy. > > public void configure() { > SimpleScheduledRoutePolicy policy = new SimpleScheduledRoutePolicy(); > long startTime = System.currentTimeMillis() + 3000L; > long stopTime = System.currentTimeMillis() + 9000L; > policy.setRouteStartDate(new Date(startTime)); > policy.setRouteStartRepeatCount(1); > policy.setRouteStopDate(new Date(stopTime)); > policy.setRouteStopRepeatCount(1); > > from(jpa) > .routeId("test") > .routePolicy(policy) > .to(databaseProcessor); > } > > The side benefit of this is that the route can be stopped and restarted as > many times as you like based on the policy.
I wonder if this would not stop it based on a time? eg looks to me you got a timespan of 6 seconds between start/stop. What you should do is to let - quartz start the route based on the scheduling you want - stop the route after processing the exchange. Just implement this in the onExchangeDone method. > > Cheers, > > Ashwin... > > ----- > --------------------------------------------------------- > Ashwin Karpe > Apache Camel Committer & Sr Principal Consultant > FUSESource (a Progress Software Corporation subsidiary) > http://fusesource.com http://fusesource.com > > Blog: http://opensourceknowledge.blogspot.com > http://opensourceknowledge.blogspot.com > --------------------------------------------------------- > -- > View this message in context: > http://camel.465427.n5.nabble.com/Using-JPA-Consumer-only-once-in-the-Route-tp3237249p3237307.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/