1
1
[[web-reactive]]
2
- = Web Reactive Framework
2
+ = Reactive Web Applications
3
+
3
4
This section provides basic information on the reactive programming
4
5
support for Web applications in Spring Framework 5.
5
6
@@ -15,16 +16,17 @@ In plain terms reactive programming is about non-blocking applications that are
15
16
and event-driven and require a small number of threads to scale vertically (i.e. within the
16
17
JVM) rather than horizontally (i.e. through clustering).
17
18
18
- A key aspect of the reactive applications is the concept of backpressure which is
19
+ A key aspect of reactive applications is the concept of backpressure which is
19
20
a mechanism to ensure producers don't overwhelm consumers. For example in a pipeline
20
- of reactive components extending from the database to the HTTP connection when the
21
- HTTP client is slow the data repository also slows down or stops until capacity frees up.
21
+ of reactive components extending from the database to the HTTP response when the
22
+ HTTP connection is too slow the data repository can also slow down or stop completely
23
+ until network capacity frees up.
22
24
23
- Reactive programming also involves a major shift from imperative style logic
24
- to declarative async composition of logic. It is comparable to using `CompletableFuture`
25
- in Java 8 and composing follow-up actions via lambda expressions.
25
+ Reactive programming also leads to a major shift from imperative to declarative async
26
+ composition of logic. It is comparable to writing blocking code vs using the
27
+ `CompletableFuture` from Java 8 to compose follow-up actions via lambda expressions.
26
28
27
- For a more extended introduction to reactive programming check the excellent multi-part series
29
+ For a longer introduction check the blog series
28
30
https://spring.io/blog/2016/06/07/notes-on-reactive-programming-part-i-the-reactive-landscape["Notes on Reactive Programming"]
29
31
by Dave Syer.
30
32
@@ -51,14 +53,14 @@ by Sebastien Deleuze.
51
53
52
54
53
55
[[web-reactive-feature-overview]]
54
- == Spring Web Reactive Overview
56
+ == Spring Web Reactive Module
55
57
56
58
Spring Framework 5 includes a new `spring-web-reactive` module. The module contains support
57
59
for reactive HTTP and WebSocket clients as well as for reactive server web applications
58
60
including REST, HTML browser, and WebSocket style interactions.
59
61
60
62
[[web-reactive-server]]
61
- === Server-Side Reactive Web Support
63
+ === Server Side
62
64
63
65
On the server-side the new reactive module supports 2 distinct programming models:
64
66
@@ -153,7 +155,7 @@ https://spring.io/blog/2016/09/22/new-in-spring-5-functional-web-framework[M3 re
153
155
154
156
155
157
[[web-reactive-client]]
156
- === Client-Side Reactive Web Support
158
+ === Client Side
157
159
158
160
Spring Framework 5 includes a functional, reactive `WebClient` that offers a fully
159
161
non-blocking and reactive alternative to the `RestTemplate`. It exposes network
@@ -190,7 +192,7 @@ still based and relies on `InputStream` and `OutputStream`.
190
192
191
193
192
194
[[web-reactive-http-body]]
193
- === Encoding and Decoding the Request and Response Body
195
+ === Request and Response Body Conversion
194
196
195
197
The `spring-core` module provides reactive `Encoder` and `Decoder` contracts
196
198
that enable the serialization of a `Flux` of bytes to and from typed objects.
0 commit comments