SpringBoot使用@Scheduled創建定時任務

1、SpringBoot中內置了@Scheduled的定時任務,首先配置這個註解,我還是基於此前創建的demo01項目,找到項目的入口方法Demo01Application添加註解@EnableScheduling 2、新建一個class文件,添加註解@Component,表明該class會被實例化爲Spring bean,被Spring管理。 (1)fixedRate屬性: 該屬性的含義是上一個
相關文章
相關標籤/搜索