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, we can immediately start coding with Flux and Mono, and don't have to stop and learn a totally new web stack. Instead, we can use the popular annotation-based programming model while we invest our effort in learning how to make things reactive. It's also important to know that Spring MVC isn't going away or slated for end of life. Both Spring WebFlux and Spring MVC will stay as actively supported options inside the Spring portfolio.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.85.221