spring-quartz.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:lang="http://www.springframework.org/schema/lang" xmlns:task="http://www.springframework.org/schema/task"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/lang
http://www.springframework.org/schema/lang/spring-lang-3.1.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-3.1.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.1.xsd">
<bean id="radarTestJobDetail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.radarTestJob" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarTestCronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarTestJobDetail" />
<!-- <property name="cronExpression" value="0 20 8,9,10,11,12,14,15,16,17,18 * * ?" /> --><!-- 8:20,12:20,18:20各执行一次 -->
<property name="cronExpression" value="0 0/5 * * * ?" /><!-- 每2分钟执行一次 -->
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<bean id="radarL0SyncJobDetail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.RRSL0DataSyncJob" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarL0SyncJobCronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarL0SyncJobDetail" />
<property name="cronExpression" value="0 0/3 * * * ?" /><!-- 每3分钟执行一次 -->
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<bean id="radarL3L2SyncJobDetail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.RRSL3DataSyncJob" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarL3L2SyncJobCronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarL3L2SyncJobDetail" />
<property name="cronExpression" value="0 0 3 * * ?" /><!-- 每1分钟执行一次 -->
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<!-- 零索赔ICCS数据去重、统计任务Job added by Tony Chen -->
<bean id="radarLspIccsQcTjJobDetail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.RadarB2BLspIccsQcTjJob" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarLspIccsQcTjCronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarLspIccsQcTjJobDetail" />
<property name="cronExpression" value="0 0 6 * * ?" /><!-- 暂定每天6点执行一次 -->
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<!-- 每日执行任务,及时率/送达率/超期未送达 -->
<bean id="radarStatisticEveryDayJobDetail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.RRSStatisticEverydayJob" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarStatisticEveryDayCronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarStatisticEveryDayJobDetail" />
<property name="cronExpression" value="0 0 2 * * ?" /><!-- 每天2点执行一次 -->
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<!-- 零索赔ICCS数据去重、统计任务Job end -->
<!-- 零索赔一次晚提、24H晚出库数据去重、统计任务Job added by Tony Chen -->
<bean id="radarLspYcwt24HwckQcTjJobDetail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.RadarB2BLspYcwt24HwckQcTjJob" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarLspYcwt24HwckQcTjCronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarLspYcwt24HwckQcTjJobDetail" />
<property name="cronExpression" value="0 0 6 * * ?" /><!-- 每天6点执行一次 -->
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<!-- 零索赔一次晚提、24H晚出库数据去重、统计任务Job end -->
<!-- 成本竞争力L3、L2统计任务Job added by Tony Chen -->
<bean id="radarCbjzlTjJobDetail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.RadarB2BCbjzlTjJob" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarCbjzlTjCronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarCbjzlTjJobDetail" />
<property name="cronExpression" value="0 10 6 * * ?" /><!-- 执行时间待定 -->
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<!-- 成本竞争力L3、L2统计任务Job end -->
<!-- B2B出库及时率L2统计任务Job added by Tony Chen -->
<bean id="radarCkjslTjJobDetail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.RadarB2BCkjslTjJob" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarCkjslTjCronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarCkjslTjJobDetail" />
<property name="cronExpression" value="0 0 7 * * ?" /><!-- 执行时间待定 -->
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<!-- B2B出库及时率L2统计任务Job end -->
<!-- B2B返单及时率L2统计任务Job added by Tony Chen -->
<bean id="radarFdjslTjJobDetail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.RadarB2BFdjslTjJob" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarFdjslTjCronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarFdjslTjJobDetail" />
<property name="cronExpression" value="0 10 7 * * ?" /><!-- 执行时间待定 -->
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<!-- B2B返单及时率L2统计任务Job end -->
<!-- B2B送达及时率L2统计任务Job added by Tony Chen -->
<bean id="radarSdjslTjJobDetail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.RadarB2BSdjslTjJob" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarSdjslTjCronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarSdjslTjJobDetail" />
<property name="cronExpression" value="0 20 7 * * ?" /><!-- 执行时间待定 -->
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<!-- B2B送达及时率L2统计任务Job end -->
<!-- Process LES L0 History Data Jobs -->
<bean id="radarL0HistJob1Detail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.radarGetHistDataJob1" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarL0HistJob1CronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarL0HistJob1Detail" />
<property name="cronExpression" value="0 0 1 * * ? 2014" /><!-- (0 0 1 * * ? 2014) 2014年每天凌晨1点执行 (0 0 2 7 8 ?)-->
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<bean id="radarL0HistJob2Detail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.radarGetHistDataJob2" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarL0HistJob2CronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarL0HistJob2Detail" />
<property name="cronExpression" value="0 0 1 * * ? 2014" /><!-- 每1分钟执行一次 -->
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<bean id="radarL0HistJob3Detail" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.radarGetHistDataJob3" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarL0HistJob3CronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarL0HistJob3Detail" />
<property name="cronExpression" value="0 0 1 * * ? 2014" /><!-- 每1分钟执行一次 -->
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<!-- process L3 History Data Jobs start-->
<bean id="radarL3HistJob1" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.RadarGetL3HistDataJob1" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarL3HistJob1CronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarL3HistJob1" />
<property name="cronExpression" value="0 0 1 * * ? 2014" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<bean id="radarL3HistJob2" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.RadarGetL3HistDataJob2" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarL3HistJob2CronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarL3HistJob2" />
<property name="cronExpression" value="0 0 1 * * ? 2014" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<bean id="radarL3HistJob3" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
<property name="jobClass"
value="com.xxxxx.openplatform.showcase.quartz.RadarGetL3HistDataJob3" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_JOB_GROUP" />
</bean>
<bean id="radarL3HistJob3CronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="radarL3HistJob3" />
<property name="cronExpression" value="0 0 1 * * ? 2014" />
<property name="group" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_TRIGGER_GROUP" />
</bean>
<!-- process L3 History Data Jobs end-->
<!-- Process LES L0 History Data Jobs -->
<!-- 任务调度管理器 -->
<bean id="clusterQuartzScheduler_1" lazy-init="false" autowire="no" class="com.xxxxx.openplatform.quartz.SchedulerFactoryBeanProxy">
<property name="schedulerName" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_schedule1"/>
<!-- Job接受applicationContext的成员变量名 -->
<property name="applicationContextSchedulerContextKey" value="applicationContext" />
<!-- 在SchedulerFactoryBean初始化完成后,延迟300秒启动Scheduler,以便让Spring能够更快初始化容器中剩余的Bean -->
<property name="startupDelay" value="180" />
<!-- 是否覆盖已有的任务 -->
<property name="overwriteExistingJobs" value="true" />
<property name="quartzProperties" ref="quartzProperties" />
<property name="triggers">
<list>
<!-- 生产环境任务 -->
<ref bean="radarStatisticEveryDayCronTriggerBean" />
</list>
</property>
<property name="startFlag" value="${quartz.enable}" />
</bean>
<bean id="clusterQuartzScheduler_2" lazy-init="false" autowire="no" class="com.xxxxx.openplatform.quartz.SchedulerFactoryBeanProxy">
<property name="schedulerName" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_schedule2"/>
<!-- Job接受applicationContext的成员变量名 -->
<property name="applicationContextSchedulerContextKey" value="applicationContext" />
<!-- 在SchedulerFactoryBean初始化完成后,延迟300秒启动Scheduler,以便让Spring能够更快初始化容器中剩余的Bean -->
<property name="startupDelay" value="120" />
<!-- 是否覆盖已有的任务 -->
<property name="overwriteExistingJobs" value="true" />
<property name="quartzProperties" ref="quartzProperties" />
<property name="triggers">
<list>
<ref bean="radarL0SyncJobCronTriggerBean" />
</list>
</property>
<property name="startFlag" value="${quartz.enable}" />
</bean>
<bean id="clusterQuartzScheduler_3" lazy-init="false" autowire="no" class="com.xxxxx.openplatform.quartz.SchedulerFactoryBeanProxy">
<property name="schedulerName" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_schedule3"/>
<!-- Job接受applicationContext的成员变量名 -->
<property name="applicationContextSchedulerContextKey" value="applicationContext" />
<!-- 在SchedulerFactoryBean初始化完成后,延迟300秒启动Scheduler,以便让Spring能够更快初始化容器中剩余的Bean -->
<property name="startupDelay" value="180" />
<!-- 是否覆盖已有的任务 -->
<property name="overwriteExistingJobs" value="true" />
<property name="quartzProperties" ref="quartzProperties" />
<property name="triggers">
<list>
<ref bean="radarLspIccsQcTjCronTriggerBean" />
<ref bean="radarCkjslTjCronTriggerBean" />
</list>
</property>
<property name="startFlag" value="${quartz.enable}" />
</bean>
<bean id="clusterQuartzScheduler_4" lazy-init="false" autowire="no" class="com.xxxxx.openplatform.quartz.SchedulerFactoryBeanProxy">
<property name="schedulerName" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_schedule4"/>
<!-- Job接受applicationContext的成员变量名 -->
<property name="applicationContextSchedulerContextKey" value="applicationContext" />
<!-- 在SchedulerFactoryBean初始化完成后,延迟300秒启动Scheduler,以便让Spring能够更快初始化容器中剩余的Bean -->
<property name="startupDelay" value="180" />
<!-- 是否覆盖已有的任务 -->
<property name="overwriteExistingJobs" value="true" />
<property name="quartzProperties" ref="quartzProperties" />
<property name="triggers">
<list>
<ref bean="radarLspYcwt24HwckQcTjCronTriggerBean" />
<ref bean="radarFdjslTjCronTriggerBean" />
</list>
</property>
<property name="startFlag" value="${quartz.enable}" />
</bean>
<bean id="clusterQuartzScheduler_5" lazy-init="false" autowire="no" class="com.xxxxx.openplatform.quartz.SchedulerFactoryBeanProxy">
<property name="schedulerName" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_schedule5"/>
<!-- Job接受applicationContext的成员变量名 -->
<property name="applicationContextSchedulerContextKey" value="applicationContext" />
<!-- 在SchedulerFactoryBean初始化完成后,延迟300秒启动Scheduler,以便让Spring能够更快初始化容器中剩余的Bean -->
<property name="startupDelay" value="180" />
<!-- 是否覆盖已有的任务 -->
<property name="overwriteExistingJobs" value="true" />
<property name="quartzProperties" ref="quartzProperties" />
<property name="triggers">
<list>
<ref bean="radarCbjzlTjCronTriggerBean" />
<ref bean="radarSdjslTjCronTriggerBean" />
</list>
</property>
<property name="startFlag" value="${quartz.enable}" />
</bean>
<!-- 历史数据job 除非跑历史数据否则不要放开 ,如果在非生产环境跑历史数据请停掉其他所有job-->
<bean id="clusterQuartzScheduler_9" lazy-init="false" autowire="no" class="com.xxxxx.openplatform.quartz.SchedulerFactoryBeanProxy">
<property name="schedulerName" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_schedule9"/>
<!-- Job接受applicationContext的成员变量名 -->
<property name="applicationContextSchedulerContextKey" value="applicationContext" />
<!-- 在SchedulerFactoryBean初始化完成后,延迟300秒启动Scheduler,以便让Spring能够更快初始化容器中剩余的Bean -->
<property name="startupDelay" value="180" />
<!-- 是否覆盖已有的任务 -->
<property name="overwriteExistingJobs" value="true" />
<property name="quartzProperties" ref="quartzProperties" />
<property name="triggers">
<list>
<ref bean="radarTestCronTriggerBean" />
<!-- 测试,生产 环境 只能有一个环境运行 -->
<!-- <ref bean="radarL3L2SyncJobCronTriggerBean" /> -->
<!-- 历史数据处理 -->
<!-- <ref bean="radarL0HistJob1CronTriggerBean" />
<ref bean="radarL0HistJob2CronTriggerBean" />
<ref bean="radarL0HistJob3CronTriggerBean" />
<ref bean="radarL3HistJob1CronTriggerBean" />
<ref bean="radarL3HistJob2CronTriggerBean" />
<ref bean="radarL3HistJob3CronTriggerBean" /> -->
</list>
</property>
<property name="startFlag" value="${quartz.enable}" />
</bean>
<!-- L3跑物料组 -->
<bean id="clusterQuartzScheduler_6" lazy-init="false" autowire="no" class="com.xxxxx.openplatform.quartz.SchedulerFactoryBeanProxy">
<property name="schedulerName" value="#{quartzProperties['org.quartz.scheduler.instanceName']}_schedule6"/>
<!-- Job接受applicationContext的成员变量名 -->
<property name="applicationContextSchedulerContextKey" value="applicationContext" />
<!-- 在SchedulerFactoryBean初始化完成后,延迟300秒启动Scheduler,以便让Spring能够更快初始化容器中剩余的Bean -->
<property name="startupDelay" value="180" />
<!-- 是否覆盖已有的任务 -->
<property name="overwriteExistingJobs" value="true" />
<property name="quartzProperties" ref="quartzProperties" />
<property name="triggers">
<list>
<ref bean="radarL3L2SyncJobCronTriggerBean" />
</list>
</property>
<property name="startFlag" value="${quartz.enable}" />
</bean>
<!-- quartz属性配置 -->
<util:properties id="quartzProperties">
<prop key="org.quartz.scheduler.instanceName">${server.name}20141020001</prop>
<prop key="org.quartz.scheduler.instanceId">AUTO</prop>
<prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
<!-- 开发环境用RAMJobStore,可加快启动速度 -->
<prop key="org.quartz.jobStore.class">org.quartz.simpl.RAMJobStore</prop>
<!-- 生产、测试环境要用TerracottaJobStore -->
<!-- <prop key="org.quartz.jobStore.class">org.terracotta.quartz.TerracottaJobStore</prop>
<prop key="org.quartz.jobStore.tcConfigUrl">${quartz.server}</prop> -->
<prop key="org.quartz.scheduler.instanceIdGenerator.class">com.xxxxx.openplatform.quartz.HostNameTimestampInstanceIdGenerator</prop>
<prop key="org.quartz.plugin.triggHistory.class">org.quartz.plugins.history.LoggingTriggerHistoryPlugin</prop>
<prop key="org.quartz.scheduler.jmx.export">true</prop>
</util:properties>
</beans>