@EnableScheduling定时任务
时间: 2023-10-12 20:05:30 浏览: 112
在Spring Boot中,@EnableScheduling注解用于开启定时任务功能。它可以被用于配置类中,通常与@Configuration一起使用。该注解会自动扫描带有@Scheduled注解的方法,并将其设置为定时任务。通过在启动类上添加@EnableScheduling注解,我们可以启用定时任务功能。例如,在启动类MainApplication中添加@EnableScheduling注解,就可以开启定时任务功能。同时,我们还可以自定义线程池以及使用@Async和@EnableAsync注解来实现多线程间的异步调用。有关Spring Boot定时任务的更多信息,可以参考SpringBoot的官方文档或者相关的技术文章。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Spring 中 @EnableScheduling 实现 定时任务](https://blog.csdn.net/liuming690452074/article/details/124764904)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [SpringBoot 注解@EnableScheduling定时任务详解](https://blog.csdn.net/qq_43649223/article/details/120437949)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Java多线程之定时任务 以及 SpringBoot多线程实现定时任务——异步任务](https://download.csdn.net/download/suixinfeixiangfei/84560169)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文