camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bvah...@apache.org
Subject git commit: CAMEL-6686: The scheduled route policies now support clustered jobs.
Date Fri, 20 Sep 2013 16:37:17 GMT
Updated Branches:
  refs/heads/camel-2.11.x 15cf97417 -> b307a0527


CAMEL-6686: The scheduled route policies now support clustered jobs.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b307a052
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b307a052
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b307a052

Branch: refs/heads/camel-2.11.x
Commit: b307a052798b2c2e0cec0ff45de78722d3c2d3c2
Parents: 15cf974
Author: Babak Vahdat <bvahdat@apache.org>
Authored: Fri Sep 20 18:09:24 2013 +0200
Committer: Babak Vahdat <bvahdat@apache.org>
Committed: Fri Sep 20 18:31:21 2013 +0200

----------------------------------------------------------------------
 .../camel/component/quartz/QuartzComponent.java |  4 +-
 .../quartz/CronScheduledRoutePolicy.java        |  2 +-
 .../quartz/ScheduledRoutePolicy.java            | 17 ++++
 .../quartz/SimpleScheduledRoutePolicy.java      |  2 +-
 ...ringQuartzPersistentStoreRestartAppTest.java |  6 +-
 ...ngQuartzPersistentStoreClusteredAppTest.java | 85 ++++++++++++++++++++
 .../SpringQuartzPersistentStoreRestartTest.xml  |  3 +-
 .../quartz/SpringQuartzPersistentStoreTest.xml  |  3 +-
 .../quartz/SpringQuartzClusteredAppOneTest.xml  | 76 +++++++++++++++++
 .../quartz/SpringQuartzClusteredAppTwoTest.xml  | 76 +++++++++++++++++
 10 files changed, 264 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b307a052/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
index 5dcc34a..a947061 100644
--- a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
+++ b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
@@ -47,7 +47,7 @@ import org.slf4j.LoggerFactory;
  * A <a href="http://camel.apache.org/quartz.html">Quartz Component</a>
  * <p/>
  * For a brief tutorial on setting cron expression see
- * <a href="http://www.opensymphony.com/quartz/wikidocs/CronTriggers%20Tutorial.html">Quartz
cron tutorial</a>.
+ * <a href="http://quartz-scheduler.org/documentation/quartz-1.x/tutorials/crontrigger">Quartz
cron tutorial</a>.
  *
  * @version
  */
@@ -184,7 +184,7 @@ public class QuartzComponent extends DefaultComponent implements StartupListener
             return;
         }
 
-        // only start scheduler when CamelContext have finished starting
+        // only start scheduler when CamelContext has finished starting
         startScheduler();
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/b307a052/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicy.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicy.java
b/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicy.java
index 500a63e..1c21f49 100644
--- a/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicy.java
+++ b/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/CronScheduledRoutePolicy.java
@@ -55,7 +55,7 @@ public class CronScheduledRoutePolicy extends ScheduledRoutePolicy implements
Sc
 
         // validate time options has been configured
         if ((getRouteStartTime() == null) && (getRouteStopTime() == null) &&
(getRouteSuspendTime() == null) && (getRouteResumeTime() == null)) {
-            throw new IllegalArgumentException("Scheduled Route Policy for route {} has no
stop/stop/suspend/resume times specified");
+            throw new IllegalArgumentException("Scheduled Route Policy for route {} has no
start/stop/suspend/resume times specified");
         }
 
         registerRouteToScheduledRouteDetails(route);

http://git-wip-us.apache.org/repos/asf/camel/blob/b307a052/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/ScheduledRoutePolicy.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/ScheduledRoutePolicy.java
b/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/ScheduledRoutePolicy.java
index c5a5731..332abbc 100644
--- a/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/ScheduledRoutePolicy.java
+++ b/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/ScheduledRoutePolicy.java
@@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.camel.Route;
 import org.apache.camel.ServiceStatus;
+import org.apache.camel.component.quartz.QuartzComponent;
 import org.apache.camel.impl.RoutePolicySupport;
 import org.apache.camel.util.ServiceHelper;
 import org.quartz.JobDetail;
@@ -82,6 +83,22 @@ public abstract class ScheduledRoutePolicy extends RoutePolicySupport implements
         updateScheduledRouteDetails(action, jobDetail, trigger, route);
         
         loadCallbackDataIntoSchedulerContext(jobDetail, action, route);
+
+        boolean isClustered = route.getRouteContext().getCamelContext().getComponent("quartz",
QuartzComponent.class).isClustered();
+        if (isClustered) {
+            // check to see if the same job has already been setup through another node of
the cluster
+            JobDetail existingJobDetail = getScheduler().getJobDetail(jobDetail.getName(),
jobDetail.getGroup());
+            if (jobDetail.equals(existingJobDetail)) {
+                if (LOG.isInfoEnabled()) {
+                    LOG.info("Skipping to schedule the job: {} for action: {} on route {}
as the job: {} already existing!",
+                             new Object[] {jobDetail.getFullName(), action, route.getId(),
existingJobDetail.getFullName()});
+                }
+
+                // skip scheduling the same job as one is already available for the same
route and action
+                return;
+            }
+        }
+
         getScheduler().scheduleJob(jobDetail, trigger);
 
         if (LOG.isInfoEnabled()) {

http://git-wip-us.apache.org/repos/asf/camel/blob/b307a052/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicy.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicy.java
b/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicy.java
index 83af957..039eeff 100644
--- a/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicy.java
+++ b/components/camel-quartz/src/main/java/org/apache/camel/routepolicy/quartz/SimpleScheduledRoutePolicy.java
@@ -64,7 +64,7 @@ public class SimpleScheduledRoutePolicy extends ScheduledRoutePolicy {
 
         // validate time options has been configured
         if ((getRouteStartDate() == null) && (getRouteStopDate() == null) &&
(getRouteSuspendDate() == null) && (getRouteResumeDate() == null)) {
-            throw new IllegalArgumentException("Scheduled Route Policy for route {} has no
stop/stop/suspend/resume times specified");
+            throw new IllegalArgumentException("Scheduled Route Policy for route {} has no
start/stop/suspend/resume times specified");
         }
 
         registerRouteToScheduledRouteDetails(route);

http://git-wip-us.apache.org/repos/asf/camel/blob/b307a052/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppTest.java
b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppTest.java
index d80a448..0dade60 100644
--- a/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppTest.java
+++ b/components/camel-quartz/src/test/java/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartAppTest.java
@@ -71,9 +71,11 @@ public class SpringQuartzPersistentStoreRestartAppTest extends TestSupport
{
 
         app2.stop();
 
-        // we're done so let's properly close the application contexts
-        app.close();
+        // we're done so let's properly close the application contexts, but stop
+        // the second app before the first one so that the quartz scheduler running
+        // inside it can properly be shutdown
         app2.close();
+        app.close();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/b307a052/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringQuartzPersistentStoreClusteredAppTest.java
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringQuartzPersistentStoreClusteredAppTest.java
b/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringQuartzPersistentStoreClusteredAppTest.java
new file mode 100644
index 0000000..889ff07
--- /dev/null
+++ b/components/camel-quartz/src/test/java/org/apache/camel/routepolicy/quartz/SpringQuartzPersistentStoreClusteredAppTest.java
@@ -0,0 +1,85 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.routepolicy.quartz;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelExecutionException;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.component.direct.DirectConsumerNotAvailableException;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.TestSupport;
+
+import org.junit.Test;
+
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ * @version 
+ */
+public class SpringQuartzPersistentStoreClusteredAppTest extends TestSupport {
+
+    @Test
+    public void testQuartzPersistentStoreClusteredApp() throws Exception {
+        // boot up the first clustered app which also launches an embedded database
+        AbstractXmlApplicationContext app = new ClassPathXmlApplicationContext("org/apache/camel/routepolicy/quartz/SpringQuartzClusteredAppOneTest.xml");
+        app.start();
+
+        // and now the second one
+        AbstractXmlApplicationContext app2 = new ClassPathXmlApplicationContext("org/apache/camel/routepolicy/quartz/SpringQuartzClusteredAppTwoTest.xml");
+        app2.start();
+
+        CamelContext camel = app.getBean("camelContext", CamelContext.class);
+        assertNotNull(camel);
+
+        MockEndpoint mock = camel.getEndpoint("mock:result", MockEndpoint.class);
+        mock.expectedMessageCount(1);
+        mock.expectedBodiesReceived("clustering pings!");
+
+        // wait a bit to make sure the route has been properly started through
+        // the given route policy
+        Thread.sleep(5000);
+
+        app.getBean("template", ProducerTemplate.class).sendBody("direct:start", "clustering");
+
+        mock.assertIsSatisfied();
+
+        CamelContext camel2 = app2.getBean("camelContext", CamelContext.class);
+        assertNotNull(camel2);
+
+        MockEndpoint mock2 = camel2.getEndpoint("mock:result", MockEndpoint.class);
+        mock.expectedMessageCount(0);
+
+        // expect no consumer being started as the seconds app is expected to
+        // run in standby modus
+        try {
+            app2.getBean("template", ProducerTemplate.class).sendBody("direct:start", "clustering");
+            fail("Should have thrown exception");
+        } catch (CamelExecutionException cee) {
+            assertIsInstanceOf(DirectConsumerNotAvailableException.class, cee.getCause());
+        }
+
+        mock2.assertIsSatisfied();
+
+        // we're done so let's properly close the application contexts, but stop
+        // the second app before the first one so that the quartz scheduler running
+        // inside it can properly be shutdown
+        app2.close();
+        app.close();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/b307a052/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartTest.xml
b/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartTest.xml
index 2c439fa..681c327 100644
--- a/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartTest.xml
+++ b/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzPersistentStoreRestartTest.xml
@@ -31,10 +31,9 @@
 
   <bean id="quartz" class="org.apache.camel.component.quartz.QuartzComponent">
     <property name="scheduler" ref="scheduler"/>
-    <property name="autoStartScheduler" value="true"/>
   </bean>
 
-  <!-- jdbc:initialize-database must come before this so the job store exists -->
+  <!-- jdbc:embedded-database must come before this so the job store exists -->
   <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
     <property name="dataSource" ref="camel_quartz"/>
     <property name="autoStartup" value="false"/>

http://git-wip-us.apache.org/repos/asf/camel/blob/b307a052/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzPersistentStoreTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzPersistentStoreTest.xml
b/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzPersistentStoreTest.xml
index 7fdf773..618a1fb 100644
--- a/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzPersistentStoreTest.xml
+++ b/components/camel-quartz/src/test/resources/org/apache/camel/component/quartz/SpringQuartzPersistentStoreTest.xml
@@ -31,10 +31,9 @@
 
   <bean id="quartz" class="org.apache.camel.component.quartz.QuartzComponent">
     <property name="scheduler" ref="scheduler"/>
-    <property name="autoStartScheduler" value="true"/>
   </bean>
 
-  <!-- jdbc:initialize-database must come before this so the job store exists -->
+  <!-- jdbc:embedded-database must come before this so the job store exists -->
   <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
     <property name="dataSource" ref="camel_quartz"/>
     <property name="autoStartup" value="false"/>

http://git-wip-us.apache.org/repos/asf/camel/blob/b307a052/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SpringQuartzClusteredAppOneTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SpringQuartzClusteredAppOneTest.xml
b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SpringQuartzClusteredAppOneTest.xml
new file mode 100644
index 0000000..79e3341
--- /dev/null
+++ b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SpringQuartzClusteredAppOneTest.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:jdbc="http://www.springframework.org/schema/jdbc"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
+       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+    ">
+
+  <!-- the persistent store for quartz -->
+  <jdbc:embedded-database id="camel_quartz" type="DERBY">
+    <jdbc:script location="classpath:tables_derby.sql"/>
+  </jdbc:embedded-database>
+
+  <bean id="quartz" class="org.apache.camel.component.quartz.QuartzComponent">
+    <property name="scheduler" ref="scheduler"/>
+    <property name="autoStartScheduler" value="true"/>
+  </bean>
+
+  <!-- jdbc:embedded-database must come before this so the job store exists -->
+  <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
+    <property name="dataSource" ref="camel_quartz"/>
+    <property name="autoStartup" value="false"/>
+    <!-- let Camel start -->
+    <property name="schedulerContextAsMap">
+      <!-- hook Camel into Quartz -->
+      <map>
+        <entry key="CamelQuartzCamelContext" value-ref="camelContext"/>
+      </map>
+    </property>
+    <property name="quartzProperties">
+      <props>
+        <prop key="org.quartz.scheduler.instanceName">myscheduler</prop>
+        <prop key="org.quartz.scheduler.instanceId">AUTO</prop>
+        <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
+        <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
+        <prop key="org.quartz.jobStore.isClustered">true</prop>
+        <prop key="org.quartz.jobStore.clusterCheckinInterval">1000</prop>
+      </props>
+    </property>
+  </bean>
+
+  <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
+    <property name="routeStartTime" value="0/3 * * * * ?" />
+  </bean>
+
+  <camelContext id="camelContext" managementNamePattern="#name#-#counter#" xmlns="http://camel.apache.org/schema/spring">
+    <template id="template" />
+    <route id="myRoute" routePolicyRef="startPolicy" autoStartup="false">
+      <from uri="direct:start" />
+      <to uri="log:triggered" />
+      <transform>
+        <simple>${in.body} pings!</simple>
+      </transform>
+      <to uri="mock:result" />
+    </route>
+  </camelContext>
+
+</beans>

http://git-wip-us.apache.org/repos/asf/camel/blob/b307a052/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SpringQuartzClusteredAppTwoTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SpringQuartzClusteredAppTwoTest.xml
b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SpringQuartzClusteredAppTwoTest.xml
new file mode 100644
index 0000000..6f6b3ea
--- /dev/null
+++ b/components/camel-quartz/src/test/resources/org/apache/camel/routepolicy/quartz/SpringQuartzClusteredAppTwoTest.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:jdbc="http://www.springframework.org/schema/jdbc"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
+       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+    ">
+
+  <!-- the persistent store for quartz -->
+  <jdbc:embedded-database id="camel_quartz" type="DERBY">
+    <!-- do not load script as database alreaady exists -->
+  </jdbc:embedded-database>
+
+  <bean id="quartz" class="org.apache.camel.component.quartz.QuartzComponent">
+    <property name="scheduler" ref="scheduler"/>
+    <property name="autoStartScheduler" value="true"/>
+  </bean>
+
+  <!-- jdbc:embedded-database must come before this so the job store exists -->
+  <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
+    <property name="dataSource" ref="camel_quartz"/>
+    <property name="autoStartup" value="false"/>
+    <!-- let Camel start -->
+    <property name="schedulerContextAsMap">
+      <!-- hook Camel into Quartz -->
+      <map>
+        <entry key="CamelQuartzCamelContext" value-ref="camelContext"/>
+      </map>
+    </property>
+    <property name="quartzProperties">
+      <props>
+        <prop key="org.quartz.scheduler.instanceName">myscheduler</prop>
+        <prop key="org.quartz.scheduler.instanceId">AUTO</prop>
+        <prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
+        <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
+        <prop key="org.quartz.jobStore.isClustered">true</prop>
+        <prop key="org.quartz.jobStore.clusterCheckinInterval">1000</prop>
+      </props>
+    </property>
+  </bean>
+
+  <bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
+    <property name="routeStartTime" value="0/3 * * * * ?" />
+  </bean>
+
+  <camelContext id="camelContext" managementNamePattern="#name#-#counter#" xmlns="http://camel.apache.org/schema/spring">
+    <template id="template" />
+    <route id="myRoute" routePolicyRef="startPolicy" autoStartup="false">
+      <from uri="direct:start" />
+      <to uri="log:triggered" />
+      <transform>
+        <simple>${in.body} pongs!</simple>
+      </transform>
+      <to uri="mock:result" />
+    </route>
+  </camelContext>
+
+</beans>


Mime
View raw message