spring 配置quartz
2017-01-09 00:00
483 查看
quartz.properties
xml配置文件
#============================================================== #Configure Main Scheduler Properties #============================================================== org.quartz.scheduler.instanceName = GameManagerQuartzScheduler org.quartz.scheduler.instanceId = AUTO #============================================================== #Configure JobStore #============================================================== org.quartz.jobStore.class =org.quartz.impl.jdbcjobstore.JobStoreTX #org.quartz.jobStore.driverDelegateClass =org.quartz.impl.jdbcjobstore.StdJDBCDelegate org.quartz.jobStore.driverDelegateClass =org.quartz.impl.jdbcjobstore.oracle.OracleDelegate org.quartz.jobStore.misfireThreshold =60000 org.quartz.jobStore.tablePrefix=MQTZ_ org.quartz.jobStore.maxMisfiresToHandleAtATime=10 org.quartz.jobStore.isClustered =true org.quartz.jobStore.clusterCheckinInterval =15000 #============================================================== #Configure ThreadPool #============================================================== org.quartz.threadPool.class= org.quartz.simpl.SimpleThreadPool org.quartz.threadPool.threadCount= 10 org.quartz.threadPool.threadPriority= 5 org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread= true #============================================================== #Skip Check Update #update:true #not update:false #============================================================== org.quartz.scheduler.skipUpdateCheck = true #============================================================================ # Configure Plugins #============================================================================ org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingJobHistoryPlugin org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin org.quartz.plugin.shutdownhook.cleanShutdown = true
xml配置文件
<!--方式一:统计每局比赛的投注情况 每5分钟执行一次--> <bean id="matchDetailBetStatJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean"> <property name="jobClass" value="com.hhly.game.manager.job.MatchDetailBetStatJob"></property> <property name="durability" value="true" /> <property name="requestsRecovery" value="true" /> </bean> <!--方式一:统计每局比赛的投注情况 每5分钟执行一次--> <bean id="matchDetailBetStatJobTiggerBean" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean"> <property name="jobDetail" ref="matchDetailBetStatJob"></property> <property name="cronExpression" value="0 */5 * * * ?"></property> </bean> <task:executor id="threadPoolTaskExecutor" pool-size="5" /> <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="jobFactory"> <bean class="org.springframework.scheduling.quartz.SpringBeanJobFactory" /> </property> <property name="dataSource" ref="dataSource" /> <property name="configLocation" value="classpath:quartz.properties" /> <property name="applicationContextSchedulerContextKey" value="applicationContextKey" /> <property name="startupDelay" value="0" /> <property name="overwriteExistingJobs" value="true" /> <property name="exposeSchedulerInRepository" value="true" /> <property name="taskExecutor" ref="threadPoolTaskExecutor" /> <property name="triggers"> <list> <ref bean="matchDetailBetStatJobTiggerBean" /> </list> </property> </bean>
相关文章推荐
- 微服务框架Spring Cloud介绍 Part2: Spring Cloud与微服务
- springmvc实现url路由功能
- spring aop 无法代理父类方法 的解决方法
- Spring MVC过滤器-超类 GenericFilterBean
- 一个jar包里的网站
- 一个jar包里的网站之文件上传
- 一个jar包里的网站之返回对媒体类型
- Spring和ThreadLocal
- Spring Boot 开发微服务
- Spring AOP动态代理-切面
- 使用MVC微信支付返回get_brand_wcpay_request:fail
- Spring整合Quartz(JobDetailBean方式)
- Spring整合Quartz(JobDetailBean方式)
- java 中Spring task定时任务的深入理解
- 模拟Spring的简单实现
- Spring整合WebSocket应用示例(上)
- spring+html5实现安全传输随机数字密码键盘