运维开发网

SpringBoot 2.1.1.RELEASE 集成quartz

运维开发网 https://www.qedev.com 2020-02-13 18:26 出处:网络 作者:铁牛2020
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>

定时任务:

@[email protected]
br/>@Configurable
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+++"");

}

}

扫码领视频副本.gif

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号