@Async Articles
3 articles about @Async. Explore Spring Boot implementation, design, and operations across related topics.
-
Why @Transactional, @Cacheable, and @Async Don't Work in Spring Boot - Understanding AOP Proxies and Self-Invocation to Fix It
@Transactional doesn't roll back, @Cacheable hits the DB every time, @Async runs synchronously. All of these are caused by how Spring AOP proxies work. This article isolates five patterns - self-invocation, private/final methods, new, and missing enablement - with reproducible code and diagnostic steps, then compares workarounds such as extracting to a separate Bean, self-injection, and TransactionTemplate.
-
How to Send Emails with JavaMailSender in Spring Boot - From Gmail/SMTP Configuration to HTML Emails
A zero-to-production guide on sending emails with JavaMailSender. Covers Gmail SMTP configuration, plain text and HTML emails, asynchronous sending with @Async, and troubleshooting common authentication errors — all with practical code examples.
-
How to Implement Asynchronous Processing in Spring Boot - Using @Async and @EnableAsync
An implementation guide for @Async / @EnableAsync, compatible with Virtual Threads in Spring Boot 3.2+ / Java 21. Learn how to speed up your API by running email sending and external API calls in the background, with production know-how covering ThreadPoolTaskExecutor sizing, RejectedExecutionHandler, graceful shutdown, MDC propagation (TaskDecorator), and CompletableFuture, all explained with implementation examples.