码迷,mamicode.com
首页 > 编程语言 > 详细

SpringBoot 2.1.1.RELEASE 集成quartz

时间:2018-12-14 01:09:21      阅读:220      评论:0      收藏:0      [点我收藏+]

标签:--   ati   cloud   配置   show   component   www.   artifact   lease   

SpringBoot 2.1.1.RELEASE 集成quartz
http://www.qchcloud.cn/system/article/show/70
依赖配置:

<!-- 定时任务 -->
    <dependency>
        <groupId>org.quartz-scheduler</groupId>
        <artifactId>quartz</artifactId>
    </dependency>

定时任务:

@Componentbr/>@Configurable
@EnableScheduling
public class WorkJobQuartz {
public long count=0;
private static final Logger log = LoggerFactory.getLogger(WorkJobQuartz.class);
@Scheduled(cron="/5 ")
public void reportByCron(){
log.debug("reportCount:"+count+++"");
}
}

SpringBoot 2.1.1.RELEASE 集成quartz

标签:--   ati   cloud   配置   show   component   www.   artifact   lease   

原文地址:http://blog.51cto.com/14042154/2330239

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!