SimpleScheduledRoutePolicyPage edited by Babak VahdatChanges (1)
Full ContentSimpleScheduledRoutePolicyAvailable as of Camel 2.6 SimpleScheduledRoutePolicy is a ScheduledRoutePolicy that facilitates route activation, de-activation, suspension and resumption of routes based on a Quartz SimpleTrigger. 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.SimpleScheduledRoutePolicy is created it can be wired into the camel route as follows Configuring the policy
SimpleScheduledRoutePolicy policy = new SimpleScheduledRoutePolicy();
long startTime = System.currentTimeMillis() + 3000L;
policy.setRouteStartDate(new Date(startTime));
policy.setRouteStartRepeatCount(1);
policy.setRouteStartRepeatInterval(3000);
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.SimpleScheduledRoutePolicy">
<property name="routeStartDate" ref="date"/>
<property name="routeStartRepeatCount" value="1"/>
<property name="routeStartRepeatInterval" value="3000"/>
</bean>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route id="myroute" routePolicyRef="startPolicy">
<from uri="direct:start"/>
<to uri="mock:success"/>
</route>
</camelContext>
See AlsoScheduledRoutePolicy - for information on policy based scheduling capability for camel routes
Stop watching space
|
Change email notification preferences
View Online
|
View Changes
|
Add Comment
|
- [CONF] Apache Camel > SimpleScheduledRo... Babak Vahdat (Confluence)
- [CONF] Apache Camel > SimpleSchedu... Babak Vahdat (Confluence)
- [CONF] Apache Camel > SimpleSchedu... Richard Kettelerij (Confluence)
