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
原文地址:http://blog.51cto.com/14042154/2330239
时间: 2024-10-06 14:03:21