Developing Java Applications with Spring and Spring Boot
by Claudio Eduardo de Oliveira, Greg L. Turnquist, Alex Antonov
Why is Spring doing this?
Spring MVC is built on top of Java EE's Servlet spec. This specification is inherently blocking and synchronous. Asynchronous support has been added in later versions, but servlets can still hold up threads in the pool while waiting for responses, defying our need for non-blocking. To build a reactive stack, things need to be reactive from top to bottom, and this requires new contracts and expectations.
Certain things, like HTTP status codes, a ResponseBody, and the @GetMapping/@PostMapping/@DeleteMapping/@PutMapping annotations are used by both modules. But other things under the hood must be rewritten from scratch. The important point is that this doesn't impact the end developer.
By switching to Reactive Spring, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access