摘要: ###1.开启定时任务 @EnableScheduling @SpringBootApplication @EnableAsync @EnableScheduling public class TaskApplication { public static void main(String[] ar 阅读全文
posted @ 2021-02-21 22:58 dkn 阅读(262) 评论(0) 推荐(0) 编辑
摘要: ###1.介绍 工作中经常涉及异步任务,通常是使用多线程技术,比如线程池ThreadPoolExecutor,但使用Executors容易产生OOM,需要手动使用ThreadPoolExecutor创建线程池;在springboot使用 @async 可以实现异步调用,配置线程池参数,可以简单的实现 阅读全文
posted @ 2021-02-21 20:59 dkn 阅读(1204) 评论(0) 推荐(0) 编辑