spring配置异步执行

1.在控制层调用spring事物业务逻辑,业务逻辑里配置async

  @Async
  public void asyncPushMsg(String personIds, CustomInfoPush entity)

2.在spring配置文件application.xml里配置:
  在beans增加:    xmlns:task="http://www.springframework.org/schema/task"
        http://www.springframework.org/schema/task
        http://www.springframework.org/schema/task/spring-task-3.0.xsd"

   在beans同级下增加任务异步扫描 <task:annotation-driven />

 

posted on 2013-07-25 11:07  阳光总在风雨后001  阅读(479)  评论(0编辑  收藏  举报

导航