Spring boot. How to Create TaskExecutor with Annotation?

后端 未结 3 1791
攒了一身酷
攒了一身酷 2020-12-30 00:15

I did a @Service class in Spring Boot application with one of the methods that should run asynchronously. As I read method should be @Async annotat

3条回答
  •  清歌不尽
    2020-12-30 00:18

    First – let’s go over the rules – @Async has two limitations:

    • it must be applied to public methods only
    • self-invocation – calling the async method from within the same class – won’t work

    So your processPage() method should be in separate class

提交回复
热议问题