Reputation: 175
As I understand - there is an opportunity to consume fewer of RAM and CPU.
As I know Servlet 3.1 already has been using NIO too. Are there any advantages in speed and/or loading?
Upvotes: 12
Views: 12019
Reputation: 59231
This is a rather broad topic - but let's clear things up first.
Spring Framework 5.0 provides an FAQ about that with several useful resources. In short, this approach can be beneficial for efficiency and scalability for workloads dealing with lots of latency and concurrency.
Indeed, Servlet 3.1 async I/O does address those issues as well, but using that API requires to depart from using the other bits of the Servlet API which are blocking. This is why Spring WebFlux doesn't expose the Servlet API in its programming model but leverages a Servlet adapter.
Upvotes: 17