The correct way to do @Async in Java Spring based applications

Spring provides an annotation @Async to run tasks in a separate thread. In Spring boot applications we can enable asynchronous tasks by adding the annotation @EnableAsync to any of the Spring configuration class as shown below: Now that we have the application setup to support asynchronous tasks, let us go ahead and create a simple … Read more