Spring Boot - @Async Annotation Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report Synchronization means every process or thread should be Synchronized together. It means executing process by process that's we can say Synchronization. This is used when one task is complete and only then does another task want to come and be executed. so It looks like there are some limitations. That's why asynchronization comes into the picture. The Asynchronization process means We are making a different thread for the same processing. Process or thread does not need to wait for someone to execute. This is The Asynchronization process. Benefits of @Async Annotation@Async annotation is used when you wanna make any method asynchronize. Annotating a method of a bean with @Async will make it execute in a separate thread. In other words, the caller will not wait for the completion of the called method. Easier to implementEasier to debugMore intuitive code flowImproved PerformanceBetter ScalabilityExample ProjectLet's Assume One example. This is a simple Java code that makes the User. Java @Entity @Table(name = "user") public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; private String email; } This is Synchronize method this method run with main thread. Java public UserDto saveUser(UserDto userDto) { User user = userToDto(userDto); System.out.println("user saved :::"+Thread.currentThread().getName()); User saveUser = userRepository.save(user); return dtoToUser(saveUser); } We are Using @Async annotation and make method as asynchronized. Java @Async @Override public void sendNotification(UserDto user) { try { Thread.sleep(3000); } catch (Exception e) { e.printStackTrace(); } System.out.println("notification sent ::" + Thread.currentThread().getName()); } @EnableAsync this application shoud enabling synchronization. Java @EnableAsync @SpringBootApplication public class BatchPrac3Application { public static void main(String[] args) { SpringApplication.run(BatchPrac3Application.class, args); } } Output:Now, we can see user save task and notification task going into different thread. because of implementing async annotations. It means notification task executed according that required time not need wait for previous task. Comment More infoAdvertise with us Next Article Spring Boot Actuator R rushitasudani Follow Improve Article Tags : Springboot Java-Spring-Boot Java-Annotation Similar Reads Spring Boot - Annotations Spring Boot Annotations are a form of metadata that provides data about a spring application. Spring Boot is built on the top of the spring and contains all the features of spring. And is becoming a favorite of developers these days because of its rapid production-ready environment which enables the 7 min read Spring Boot Actuator Developing and managing an application are the two most important aspects of the applicationâs life cycle. It is very important to know what is going on beneath the application. Also, when we push the application into production, managing it gradually becomes critically important. Therefore, it is a 5 min read Spring Boot - @SpringBootApplication Annotation In Spring Boot, simplifying application configuration is a key objective, and the @SpringBootApplication annotation plays a pivotal role in achieving this. Spring Boot, an extension of the Spring Framework, offers developers a rapid way to develop standalone applications. The @SpringBootApplication 4 min read Finding All Beans with a Custom Annotation in Spring boot In Spring Boot, developers often define beans (components, services, etc.) to be managed automatically by the Spring IoC (Inversion of Control) container. Sometimes, it's helpful to identify beans marked with a specific custom annotation for special handlingâwhether for applying certain behavior or 5 min read Spring Boot - Architecture Spring Boot is built on top of the core Spring framework. It simplifies and automates Spring-based application development by reducing the need for manual configuration. Spring Boot follows a layered architecture, where each layer interacts with other layers in a hierarchical order. The official Spr 3 min read Spring Boot - @PathVariable and @RequestParam Annotations When building RESTful APIs with Spring Boot, it's crucial to extract data from incoming HTTP requests to process and respond accordingly. The Spring framework provides two main annotations for this purpose: @PathVariable and @RequestParam.The @PathVariable annotation is used to retrieve data from th 7 min read Like