Spring 4 + Spring Tutorial Batch + Quartz 2.2.x

I am looking for a few days for a simple Spring batch processor implementation with a scheduler (Quartz), but no luck! all the samples on which I laid hands did not work or did not depreciate, my application should ensure that the response time is set dynamically (retrieved from the database)

+3
source share
1 answer

try adding the code below to spring -quartz.xml

                

<!--testAlerts cron trigger -->
<bean id="testAlertsTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
    <property name="name" value="testAlertsTrigger" />
    <property name="jobDetail" ref="testAlertsJobDetail" />
    <property name="cronExpression" value="0 0 4 * * ?" />
</bean>

<!-- scheduler -->
<bean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
    <property name="dataSource" ref="dataSource" />
    <property name="transactionManager" ref="hbnTransactionManager" />
    <property name="triggers">
        <list>
              <ref bean="testAlertsTrigger" />
        </list>
    </property>
    <property name="schedulerContextAsMap">
        <map>
            <entry key="commandDispatcher" value-ref="commandDispatcher" />
        </map>
    </property>
    <property name="autoStartup" value="${QUARTZ.org.quartz.autoStartup}" />
    <property name="overwriteExistingJobs" value="${QUARTZ.org.quartz.overwriteExistingJobs}" />
    <property name="quartzProperties">
        <props>
            <prop key="org.quartz.scheduler.instanceId">${QUARTZ.org.quartz.scheduler.instanceId}</prop>
            <prop key="org.quartz.scheduler.instanceName">${QUARTZ.org.quartz.scheduler.instanceName}</prop>
            <prop key="org.quartz.threadPool.threadCount">${QUARTZ.org.quartz.threadPool.threadCount}</prop>
            <prop key="org.quartz.jobStore.class">${QUARTZ.org.quartz.jobStore.class}</prop>
            <prop key="org.quartz.jobStore.isClustered">${QUARTZ.org.quartz.jobStore.isClustered}</prop>
            <prop key="org.quartz.jobStore.clusterCheckinInterval">${QUARTZ.org.quartz.jobStore.clusterCheckinInterval}</prop>
        </props>
    </property>
</bean>

                

0
source

All Articles