Reactive Guide for Spring MVC - Rossen Stoyanchev

Pivotal 418 views 16 slides Feb 20, 2019
Slide 1
Slide 1 of 16
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16

About This Presentation

Reactive Guide for Spring MVC by Rossen Stoyanchev at SpringOne Tour 2019


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

Source code
https://github.com/rstoyanchev/reactive-for-webmvc

Q & A