CompletableFuture vs Spring Transactions

前端 未结 2 733
梦如初夏
梦如初夏 2021-01-17 22:01

Idea

I have a processing method which takes in a list of items and processes them asynchronously using external web service. The process steps also

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-17 22:18

    In case of Spring Boot Application , you need following configurations.

    The main application method should be annotated with @EnableAsync.

    @Async annotation should be on the top of method having @Transactional annotation. This is necessary to indicate processing will be taking place in child thread.

提交回复
热议问题