CronScheduledRoutePolicyPage edited by Claus IbsenChanges (8)
Full ContentCronScheduledRoutePolicyCronScheduledRoutePolicy is a ScheduledRoutePolicy that facilitates route activation, de-activation, suspension and resumption of routes based on a Quartz CronTrigger. Maven users will need to add a camel-quartz dependency to their pom.xml to avail this capability. <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-quartz</artifactId> <version>x.x.x</version> <!-- use the same version as your Camel core version --> </dependency>
Once the org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy is created it can be wired into the camel route as follows Configuring the policy
CronScheduledRoutePolicy policy = new CronScheduledRoutePolicy(); policy.setRouteStartTime("*/3 * * * * ?"); from("direct:start") .routeId("test") .routePolicy(policy) .to("mock:success");;
<bean id="date" class="org.apache.camel.routepolicy.quartz.SimpleDate"/> <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy"> <property name="routeStartTime" value="*/3 * * * * ?"/> </bean> <camelContext xmlns="http://camel.apache.org/schema/spring"> <route id="testRoute" routePolicyRef="startPolicy"> <from uri="direct:start"/> <to uri="mock:success"/> </route> </camelContext> See AlsoScheduledRoutePolicy - for information on policy based scheduling capability for camel routes
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
- [CONF] Apache Camel > CronScheduledRoutePolicy confluence