SpringBoot使用@Scheduled创建定时任务

1、SpringBoot中内置了@Scheduled的定时任务,首先配置这个注解,我还是基于此前创建的demo01项目,找到项目的入口方法Demo01Application添加注解@EnableScheduling 2、新建一个class文件,添加注解@Component,表明该class会被实例化为Spring bean,被Spring管理。 (1)fixedRate属性: 该属性的含义是上一个
相关文章
相关标签/搜索