Spring @Async Not Working

后端 未结 11 715
北荒
北荒 2020-12-08 06:30

An @Async method in a @Service-annotated class is not being called asynchronously - it\'s blocking the thread.

I\'ve got

11条回答
  •  死守一世寂寞
    2020-12-08 07:13

    Firstly make your .xml config looks like:

    
    
    
    

    (Yes, scheduler count and executor thread pool size is configurable)

    Or just use default:

    
    
    

    Secondly make sure @Async methods are public.

提交回复
热议问题