有沒有辦法可以爲不同的類指定不同的執行程序?看起來有點束縛,不得不爲每個異步任務使用一個Executor。Spring @Async Executor
1
A
回答
1
您可以有多個相同任務執行程序類型(池)的實例。但是你不能擁有不同的游泳池。
。例如ThreadPoolTaskExecutor
或
<task:executor id="executorWithPoolSizeRange"
pool-size="5-25"
queue-capacity="100"/>
<task:executor id="executor" pool-size="10"/>
10個實例詳情請參閱彈簧參考 @see Spring Reference Chapter 25 Task Execution and Scheduling
3
相關問題
- 1. Spring Boot ASync + AutoWired Executor vs manual Executor + Future/Callable?
- 2. Spring @Async不工作
- 3. Spring @Async保存搜索
- 4. Spring Boot - @Async被忽略
- 5. Spring MVC和@Async
- 6. Spring @Async性能
- 7. @Async with Spring 3.0.6
- 8. Spring @Async和AbstractRoutingDataSource
- 9. Spring @Async生成LazyInitializationExceptions
- 10. Gzip filter with spring async
- 11. Spring 3爲ThreadPoolTaskExecutor設置ThreadFactory
- 12. Spring ThreadPoolTaskExecutor只運行一個線程
- 13. Hystrix和Spring @Async組合
- 14. Spring Integration 4.3中的Async ServiceActivator
- 15. Spring @Async批註導致java.io.NotSerializableException?
- 16. Spring xml config enable @Async without @Scheduled
- 17. Spring MVC @Async限制任務
- 18. Spring @Async不起作用
- 19. Spring Boot @Async同步運行
- 20. 帶App Engine的Spring @Async?
- 21. Spring上的Async Rest方法不是異步執行的
- 22. 春ThreadPoolTaskScheduler VS ThreadPoolTaskExecutor類
- 23. 如何在Spring中正確使用@Async
- 24. 一起使用Spring @Scheduled和@Async
- 25. Spring Boot啓用<async-supported> like web.xml
- 26. 接口方法上的Spring @Async註釋
- 27. 使用Spring的Apache CXF Async Conduit和NTLM?
- 28. Spring中的@Async與Reactor線程池
- 29. 線程管理/ Spring的工作@Async
- 30. @Async Spring註解不起作用
你可以讓池中的執行器有足夠的線程。 – 2012-01-05 23:56:29