SpringBoot 2.1.1.RELEASE 集成quartz

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+++"");
}
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章