java spring boot ScheduledExecutorService
时间: 2023-10-20 20:32:35 浏览: 147
Java Spring Boot中的ScheduledExecutorService是一个Java定时器工具类,可以用于在Spring Boot应用程序启动时启动和运行任务。你可以使用自定义的定时器工具类,结合Spring Boot一起使用。另外,你也可以使用ScheduledExecutorService接口提供的方法来创建一个定时任务执行线程池。例如,在Spring Boot中,你可以通过@Bean注解来创建一个ScheduledExecutorService实例,并将其注入到需要使用的地方。这样,你就可以使用这个线程池来执行周期性的定时任务。如果在Spring Boot中找不到默认的ScheduledExecutorService实例,系统将会抛出NoSuchBeanDefinitionException异常,并打印出相应的错误信息。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [自定义Java-ScheduledExecutorService定时器.jar](https://download.csdn.net/download/wsk1103/10230495)[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_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [scheduledexecutorservice 的使用_SpringBoot @Schedule使用注意与原理](https://blog.csdn.net/weixin_39574869/article/details/110998360)[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_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [spring boot.定时任务问题记录(TaskScheduler/ScheduledExecutorService异常)](https://blog.csdn.net/acj2008/article/details/101941093)[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_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文