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()
{
}
Question1- Can someone please explain if @Async can work without @EnableAsync
Question2- I need to implement a asynchronous method and perform a long running task on a separate thread and return response from an API without waiting for this long running task to complete. For this i will have to use @EnableAsync. Will Adding @EnableAsync to @SpringBootApplication affect other existing Apis which are decorated with @Async
Question3 - There are many classes decorated with @Configuration. Can I use any of these to decorate with @EnableAsync. Which one can I use since many classes have @Configuration