What’s the Difference Between @Async
and Spring WebFlux?
Both help you do things asynchronously in Spring — but they’re not the same.
@Async
:
Works in traditional Spring MVC.
Runs the method on a new thread, using a thread pool.
Still uses blocking I/O — threads wait for things like DB calls or file access.
Best for simple background tasks like sending emails or logging.
Easy to use, but not great for handling lots of users or real-time data.
WebFlux:
Uses reactive programming (Mono
, Flux
).
Built for non-blocking, event-driven apps.
Doesn’t need a new thread per request — super efficient under high load.
Supports backpressure (lets slow consumers avoid being overwhelmed).
Great for APIs, streaming data, or apps that handle lots of users at once.