From d61db48d643834c89e5c277fda8ea798d17c9db7 Mon Sep 17 00:00:00 2001 From: Sebastien Deleuze Date: Wed, 23 Aug 2017 13:53:58 +0200 Subject: [PATCH] Improve WebFlux documentation sections Issue: SPR-15149 --- src/docs/asciidoc/web.adoc | 2 -- .../asciidoc/web/web-flux-functional.adoc | 2 +- src/docs/asciidoc/web/web-flux.adoc | 33 +++++++++---------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/docs/asciidoc/web.adoc b/src/docs/asciidoc/web.adoc index 600256dcd0..679d6195ff 100644 --- a/src/docs/asciidoc/web.adoc +++ b/src/docs/asciidoc/web.adoc @@ -23,6 +23,4 @@ include::web/web-websocket.adoc[leveloffset=+1] include::web/web-flux.adoc[leveloffset=+1] -include::web/web-flux-functional.adoc[leveloffset=+1] - include::web/web-integration.adoc[leveloffset=+1] diff --git a/src/docs/asciidoc/web/web-flux-functional.adoc b/src/docs/asciidoc/web/web-flux-functional.adoc index ba34c848e9..73159587aa 100644 --- a/src/docs/asciidoc/web/web-flux-functional.adoc +++ b/src/docs/asciidoc/web/web-flux-functional.adoc @@ -1,5 +1,5 @@ [[webflux-fn]] -= Spring WebFlux Functional Programming Model += Functional Programming Model [[webflux-fn-handler-functions]] == HandlerFunctions diff --git a/src/docs/asciidoc/web/web-flux.adoc b/src/docs/asciidoc/web/web-flux.adoc index d0c6968d2a..de67fa9ae4 100644 --- a/src/docs/asciidoc/web/web-flux.adoc +++ b/src/docs/asciidoc/web/web-flux.adoc @@ -5,11 +5,11 @@ This section provides basic information on the reactive programming support for Web applications in Spring Framework 5. -[[web-reactive-intro]] +[[webflux-intro]] == Introduction -[[web-reactive-programming]] +[[webflux-intro-reactive-programming]] === What is Reactive Programming? In plain terms reactive programming is about non-blocking applications that are asynchronous @@ -31,7 +31,7 @@ https://spring.io/blog/2016/06/07/notes-on-reactive-programming-part-i-the-react by Dave Syer. -[[web-reactive-api]] +[[webflux-intro-reactive-api]] === Reactive API and Building Blocks Spring Framework 5 embraces @@ -52,14 +52,14 @@ https://spring.io/blog/2016/04/19/understanding-reactive-types["Understanding Re by Sebastien Deleuze. -[[web-reactive-feature-overview]] +[[webflux-feature-overview]] == Spring WebFlux Module Spring Framework 5 includes a new `spring-webflux` module. The module contains support for reactive HTTP and WebSocket clients as well as for reactive server web applications including REST, HTML browser, and WebSocket style interactions. -[[web-reactive-server]] +[[webflux-server]] === Server Side On the server-side WebFlux supports 2 distinct programming models: @@ -84,7 +84,7 @@ request and response as `Flux`, rather than REST-style JSON and XML serialization and deserialization is supported on top as a `Flux`, and so is HTML view rendering and Server-Sent Events. -[[web-reactive-server-annotation]] +[[webflux-server-annotation]] ==== Annotation-based Programming Model The same `@Controller` programming model and the same annotations used in Spring MVC @@ -123,13 +123,10 @@ public class PersonController { } ---- -[[web-reactive-server-functional]] -==== Functional Programming Model - -include::web-flux-functional.adoc[leveloffset=+1] +include::web-flux-functional.adoc[leveloffset=+3] -[[web-reactive-client]] +[[webflux-client]] === Client Side WebFlux includes a functional, reactive `WebClient` that offers a fully @@ -163,7 +160,7 @@ still based and relies on `InputStream` and `OutputStream`. ==== -[[web-reactive-http-body]] +[[webflux-http-body]] === Request and Response Body Conversion The `spring-core` module provides reactive `Encoder` and `Decoder` contracts @@ -218,7 +215,7 @@ default as following: reading SSE streams as well. -[[web-reactive-websocket-support]] +[[webflux-websocket-support]] === Reactive WebSocket Support WebFlux includes reactive WebSocket client and server support. @@ -259,7 +256,7 @@ WebSocketClient client = new ReactorNettyWebSocketClient(); client.execute("ws://localhost:8080/echo"), session -> {... }).blockMillis(5000); ---- -[[web-reactive-tests]] +[[webflux-tests]] === Testing The `spring-test` module includes a `WebTestClient` that can be used to test @@ -276,11 +273,11 @@ in the framework. -[[web-reactive-getting-started]] +[[webflux-getting-started]] == Getting Started -[[web-reactive-getting-started-boot]] +[[webflux-getting-started-boot]] === Spring Boot Starter The @@ -292,7 +289,7 @@ By default the starter runs with Reactor Netty but the dependencies can be chang with Spring Boot to switch to a different runtime. See the Spring Boot reference documentation page for more details and instruction. -[[web-reactive-getting-started-manual]] +[[webflux-getting-started-manual]] === Manual Bootstrapping This section outlines the steps to get up and running manually. @@ -367,7 +364,7 @@ You will need to implement one abstract method in order to point to your Spring configuration. ==== -[[web-reactive-getting-started-examples]] +[[webflux-getting-started-examples]] === Examples You will find code examples useful to build reactive Web application in the following projects: