SpringBoot是否会自动注入一个线程池
来源:10-11 使用MQ解耦点赞通知功能

此间道
2022-03-15
自动配置类TaskExecutionAutoConfiguration,创建的public ThreadPoolTaskExecutor applicationTaskExecutor,是否是默认的线程池
而且并发测试时,确实会出现有多个异步线程同时开始.
2022-03-16 17:20:01.134 [http-nio-8087-exec-1] INFO c.s.template.controller.test.AsyncController - http-nio-8087-exec-1====end2=====
2022-03-16 17:20:01.134 [http-nio-8087-exec-6] INFO c.s.template.controller.test.AsyncController - http-nio-8087-exec-6====end2=====
2022-03-16 17:20:01.134 [task-18] INFO cj.springboot.template.service.test.CJAsyncService - task-18====start=====
2022-03-16 17:20:01.134 [task-17] INFO cj.springboot.template.service.test.CJAsyncService - task-17====start=====
2022-03-16 17:20:01.134 [task-16] INFO cj.springboot.template.service.test.CJAsyncService - task-16====start=====
1回答
-
甲蛙
2022-03-15
是指异步化@Async吗?没有自动加线程池,可以自己配置一个线程池,让所有的异步线程在一个池里
022022-03-17
相似问题