All Downloads are FREE. Search and download functionalities are using the official Maven repository.

quartz.quartz-camel-context.xml Maven / Gradle / Ivy

There is a newer version: 12.0.0
Show newest version
<!--
  #%L
  Wildfly Camel :: Testsuite
  %%
  Copyright (C) 2013 - 2015 RedHat
  %%
  Licensed 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.
  #L%
  -->
<beans xmlns:jdbc="http://www.springframework.org/schema/jdbc"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://www.springframework.org/schema/beans"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
       http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd">

    <jdbc:embedded-database id="quartzDataSource" type="H2">
        <jdbc:script location="db-schema.sql"/>
    </jdbc:embedded-database>

    <bean id="myScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        <property name="dataSource" ref="quartzDataSource"/>
        <property name="autoStartup" value="false"/>
        <property name="schedulerContextAsMap">
            <!-- hook Camel into Quartz -->
            <map>
                <entry key="CamelQuartzCamelContext-camelContext" value-ref="quartz-context"/>
            </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.terracotta.quartz.skipUpdateCheck">true</prop>
                <prop key="org.quartz.jobStore.driverDelegateClass">org.quartz.impl.jdbcjobstore.StdJDBCDelegate</prop>
                <prop key="org.quartz.jobStore.isClustered">false</prop>
            </props>
        </property>
    </bean>

    <bean id="quartz2" class="org.apache.camel.component.quartz2.QuartzComponent">
        <property name="scheduler" ref="myScheduler"/>
    </bean>

    <camelContext id="quartz-context" xmlns="http://camel.apache.org/schema/spring">
        <route id="myRoute">
            <from uri="quartz2://app/test?trigger.repeatInterval=1000&amp;trigger.repeatCount=-1&amp;stateful=true"/>
            <log message="Fired: ${header.CamelCreatedTimestamp}"/>
            <to uri="mock:result"/>
        </route>
    </camelContext>

</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy