Reactive Guide for Spring MVC by Rossen Stoyanchev at SpringOne Tour 2019
Size: 47.47 KB
Language: en
Added: Feb 20, 2019
Slides: 16 pages
Slide Content
Guide to “Reactive”
for Spring MVC
Rossen Stoyanchev
About me
Spring Framework since 3.0
Evolution of Spring MVC programming model
Design and creation of WebFlux
Ugh, not another “reactive” talk...
but seriously,
how do you get on top of it?
... and cut through the learning curve
We could talk about concurrency models
We can talk about
efficient scale with less (hardware) resources
We can talk about
growing asynchronicity in applications,
resilience under load, and so on...
All that talk wouldn’t be as effective as
seeing benefits in existing apps
Goals for Today
Demonstrate reactive features for Spring MVC applications
Start learning, get experience
For tangible benefits
Agenda
RestTemplate vs WebClient
Spring MVC controller reactive handling
Reactive client libraries
Testing
Best Practices
Find vertical slices suited for wholesale conversion
Where handling involves waiting for network I/O
More latency, more benefit
Best Practices
Avoid block, subscribe, etc. in controllers and services
Instead compose a single, deferred chain
Return Flux/Mono and let Spring MVC handle it
Best Practices
Non-blocking code should have a non-blocking API
It’s easy to add a synchronous facade on top
The goal is to enable composing single deferred chain