關于Spring中的@Async的使用問題在使用過程中發現在applicationContext.xml中僅配置 <task:annotation-driven/> 就可以使用@Async注解處理異步第一種配置:
<task:annotation-driven/>
第二種配置:
<task:annotation-driven executor="myExecutor"/>
<task:executor id="myExecutor" pool-size="5-10" queue-capacity="200" keep-alive="180" rejection-policy="ABORT"/>之前一直使用的是第一種配置,使用spring的默認線程池來處理。但在查詢各種@Async的使用方法時,都是使用的第二種配置方式。想請教一下使用第一種有什么弊端,這兩種有什么區別
Spring @Async 注解的配置使用問題
白豬掌柜的
2018-10-24 10:24:18