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.
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.