@Async, @ControllerAdvice Global Exception Handling, MockMvc, Cors configuration, AOP Logging
✅ 1. @Async – Asynchronous Execution 🔹 Code: @Configuration@EnableAsyncpublic class AppConfig {} 🔸 Explanation: 🔹 Service: @Servicepublic class EmailService { @Async public void sendEmail(String to) { System.out.println(“Sending email to: ” + to); try { Thread.sleep(3000); // simulate delay } catch (InterruptedException e) { e.printStackTrace(); } System.out.println(“Email sent to: ” +…
