<!--配置对应的package名-->
<context:component-scan base-package="com.sycamore.asynchronous" />
<!--开启注解调度支持 @Async @Scheduled --><task:scheduler id="scheduler" pool-size="10" />
<task:annotation-driven executor="executor"
scheduler="scheduler" />
<task:executor id="executor" pool-size="10"
queue-capacity="10" />
<!-- 注解驱动,使spring的controller全部生效 -->
<aop:aspectj-autoproxy proxy-target-class="true" expose-proxy="true"/>
在对应的package下 要用到异步的方法 加上 @Async 注解