小编kim*_*hra的帖子

如果没有@EnableAsync,@Async 是否可以工作?

I am new to Java and working on an existing Spring MVC application. The project has a controller where many endponts are decorated with @Async annotation. But nowhere in the project did I find @EnableAsync annotation.I know @EnableAsync should be placed in one of the @Configuration classes or @SpringBootApplication classes. So I am not sure how the @Async is working of these existing endpoints

@RequestMapping(method= RequestMethod.POST, values= /endpoint1, consumes="application/json"
@Async
Public CompletableFuture<String> resultsForEndpoint1()
{
}
Run Code Online (Sandbox Code Playgroud)

Question1- Can someone please …

java asynchronous spring-mvc spring-annotations spring-boot

5
推荐指数
1
解决办法
713
查看次数