SlideShare a Scribd company logo
Reactive Web 101:
WebFlux, WebClient, and
Reactor Netty
Violeta Georgieva
@violeta_g_g
Violeta Georgieva
• Pivotal
• Spring Framework contributor
• Reactor Netty committer
• Tomcat committer
2
Agenda
• Blocking, Non-blocking and Reactive IO
• Spring Framework 5 Reactive Web
• WebFlux
• WebClient
• Reactor Netty
• Demo
3
Blocking, Non-blocking and
Reactive IO
Synchronous Blocking IO
5
Waiting for response
Remote
Http Call
Another Remote
Http Call
Remote Http
Call Execution
Network Latency
Processing Latency
Synchronous Blocking IO
6
Waiting for response
Waiting for response
Waiting for response
…
Cannot Process
Anymore
Asynchronous Blocking IO
7
Remote
Http Call
Another Remote
Http Call
Remote Http
Call Execution
Network Latency
Processing Latency
Waiting for response
Asynchronous Blocking IO
8
Waiting for response
Waiting for response
…
Waiting for response
…
Cannot Process
Anymore
Non-blocking IO
9
Remote
Http Call
Another Remote
Http Call
Remote Http
Call Execution
Network Latency
Processing Latency
Non-blocking IO
10
Network Latency
Processing Latency
…
…
Non-blocking IO
Event Loop
Requests,
etc.
Intensive Operations
Remote CallsRegister callback
File System
Database
Remote CallOperation Complete
Trigger Callback
Computation
Reactive IO
12
Reactive IO
13
Spring Framework 5 Reactive
Web
15
Spring WebFlux
16
Functional Endpoints
Spring Framework 5.2
Spring WebFlux
Reactor Netty
Reactor Netty
• Reactive Streams API for Netty
• Hides the complexity of Netty
• Build-in Backpressure support
18
Reactor Netty
19
Prepares the response
Sends “Hello World”
Configures the port
Prepares the pipeline
Configures the server
Reactor Netty
20
Configures the port
Sends “Hello World”
Creates the server
Reactor Netty
• Supports UDP, TCP and HTTP
• Spring Boot 2 reactive web starter - default server runtime
• WebClient by default it is based on Reactor Netty
21
DEMO
THANKS
https://github.com/reactor/head-first-reactive-with-spring-and-reactor/tree/complete
https://github.com/reactor/head-first-reactive-with-spring-and-reactor/tree/rest-
template-example

More Related Content

Reactive Web 101: WebFlux, WebClient, and Reactor Netty