Embed presentation
































![Reactor18Flux<String> s = Flux.just("a", "b", "c", "d").map(String::toUpperCase);s.log("demo").subscribe();Need to be subscribed!00:58:33.902 [main] INFO demo - | request(unbounded)00:58:33.903 [main] INFO demo - | onNext(A)00:58:33.903 [main] INFO demo - | onNext(B)00:58:33.903 [main] INFO demo - | onNext(C)00:58:33.903 [main] INFO demo - | onNext(D)00:58:33.903 [main] INFO demo - | onComplete()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-33-2048.jpg&f=jpg&w=240)

![Reactor19Flux<String> s = Flux.just("a", "b", "c", "d").map(String::toUpperCase).delayElements(Duration.ofSeconds(1));s.log("demo").subscribe();00:59:42.949 [main] INFO demo - request(unbounded)00:59:43.992 [parallel-1] INFO demo - onNext(A)00:59:44.994 [parallel-2] INFO demo - onNext(B)00:59:45.997 [parallel-3] INFO demo - onNext(C)00:59:46.999 [parallel-4] INFO demo - onNext(D)00:59:47.001 [parallel-4] INFO demo - onComplete()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-35-2048.jpg&f=jpg&w=240)






























![40$ curl -v -H "Accept: text/event-stream" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: text/event-stream>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: text/event-stream<data:{"text":"a"}data:{"text":"a"}data:{"text":"a"}...INFO 48330 --- [ctor-http-nio-2] message : request(1)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : request(31)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : request(24)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-2] message : request(24)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-2] message : onComplete()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-66-2048.jpg&f=jpg&w=240)
![40$ curl -v -H "Accept: text/event-stream" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: text/event-stream>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: text/event-stream<data:{"text":"a"}data:{"text":"a"}data:{"text":"a"}...INFO 48330 --- [ctor-http-nio-2] message : request(1)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : request(31)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : request(24)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-2] message : request(24)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-2] message : onComplete()Backpressure](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-67-2048.jpg&f=jpg&w=240)

![(FYI) In case of Servlet Stack41INFO 61528 --- [nio-8080-exec-1] message : request(1)INFO 61528 --- [nio-8080-exec-1] message : onNext(a)INFO 61528 --- [ MvcAsync1] message : request(1)INFO 61528 --- [ MvcAsync1] message : onNext(a)INFO 61528 --- [ MvcAsync2] message : request(1)... ...INFO 61528 --- [ MvcAsync98] message : request(1)INFO 61528 --- [ MvcAsync98] message : onNext(a)INFO 61528 --- [ MvcAsync99] message : request(1)INFO 61528 --- [ MvcAsync99] message : onNext(a)INFO 61528 --- [ MvcAsync99] message : onComplete()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-69-2048.jpg&f=jpg&w=240)
![(FYI) In case of Servlet Stack41INFO 61528 --- [nio-8080-exec-1] message : request(1)INFO 61528 --- [nio-8080-exec-1] message : onNext(a)INFO 61528 --- [ MvcAsync1] message : request(1)INFO 61528 --- [ MvcAsync1] message : onNext(a)INFO 61528 --- [ MvcAsync2] message : request(1)... ...INFO 61528 --- [ MvcAsync98] message : request(1)INFO 61528 --- [ MvcAsync98] message : onNext(a)INFO 61528 --- [ MvcAsync99] message : request(1)INFO 61528 --- [ MvcAsync99] message : onNext(a)INFO 61528 --- [ MvcAsync99] message : onComplete()✅ Backpressure](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-70-2048.jpg&f=jpg&w=240)

![42$ curl -v -H "Accept: application/stream+json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/stream+json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/stream+json;charset=UTF-8<{"text":"a"}{"text":"a"}{"text":"a"}...INFO 48330 --- [ctor-http-nio-4] message : request(1)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : request(31)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : request(24)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-4] message : request(24)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-4] message : onComplete()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-72-2048.jpg&f=jpg&w=240)
![42$ curl -v -H "Accept: application/stream+json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/stream+json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/stream+json;charset=UTF-8<{"text":"a"}{"text":"a"}{"text":"a"}...INFO 48330 --- [ctor-http-nio-4] message : request(1)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : request(31)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : request(24)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-4] message : request(24)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-4] message : onComplete()✅ Backpressure](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-73-2048.jpg&f=jpg&w=240)
![43$ curl -v -H "Accept: application/json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/json;charset=UTF-8<[{"text":"a"},{"text":"a"},...,{"text":"a"},{"text":"a"},{"text":"a"},{"text":"a"}]](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-74-2048.jpg&f=jpg&w=240)
![43$ curl -v -H "Accept: application/json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/json;charset=UTF-8<[{"text":"a"},{"text":"a"},...,{"text":"a"},{"text":"a"},{"text":"a"},{"text":"a"}]INFO 48330 --- [ctor-http-nio-3] message : request(unbounded)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onComplete()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-75-2048.jpg&f=jpg&w=240)
![43$ curl -v -H "Accept: application/json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/json;charset=UTF-8<[{"text":"a"},{"text":"a"},...,{"text":"a"},{"text":"a"},{"text":"a"},{"text":"a"}]INFO 48330 --- [ctor-http-nio-3] message : request(unbounded)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onComplete()❌ Backpressure](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-76-2048.jpg&f=jpg&w=240)

![Flux -> Mono45@GetMapping("hello")public Mono<List<Message>> hello() {return Mono.just(new Message("a")).repeat().take(100).collectList().log("message");}$ curl -v -H "Accept: application/stream+json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/stream+json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/stream+json;charset=UTF-8<[{"text":"a"},{"text":"a"},...,{"text":"a"},{"text":"a"},{"text":"a"},{"text":"a"}]](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-78-2048.jpg&f=jpg&w=240)
![Flux -> Mono45@GetMapping("hello")public Mono<List<Message>> hello() {return Mono.just(new Message("a")).repeat().take(100).collectList().log("message");}$ curl -v -H "Accept: application/stream+json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/stream+json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/stream+json;charset=UTF-8<[{"text":"a"},{"text":"a"},...,{"text":"a"},{"text":"a"},{"text":"a"},{"text":"a"}]INFO 48330 --- [ctor-http-nio-3] message : | request(1)INFO 48330 --- [ctor-http-nio-3] message : | onNext([a, a, a, a,a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a,a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a,a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a])INFO 48330 --- [ctor-http-nio-3] message : | request(31)INFO 48330 --- [ctor-http-nio-3] message : | onComplete()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-79-2048.jpg&f=jpg&w=240)
![Flux -> Mono45@GetMapping("hello")public Mono<List<Message>> hello() {return Mono.just(new Message("a")).repeat().take(100).collectList().log("message");}$ curl -v -H "Accept: application/stream+json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/stream+json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/stream+json;charset=UTF-8<[{"text":"a"},{"text":"a"},...,{"text":"a"},{"text":"a"},{"text":"a"},{"text":"a"}]INFO 48330 --- [ctor-http-nio-3] message : | request(1)INFO 48330 --- [ctor-http-nio-3] message : | onNext([a, a, a, a,a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a,a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a,a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a])INFO 48330 --- [ctor-http-nio-3] message : | request(31)INFO 48330 --- [ctor-http-nio-3] message : | onComplete()❌ Backpressure](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-80-2048.jpg&f=jpg&w=240)





























![66<html><body><ul><li data-th-each="user : ${user}">[[${user}]]</li></ul></body></html>](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-110-2048.jpg&f=jpg&w=240)
![66<html><body><ul><li data-th-each="user : ${user}">[[${user}]]</li></ul></body></html>😀 Spring WebFlux](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-111-2048.jpg&f=jpg&w=240)
![66<html><body><ul><li data-th-each="user : ${user}">[[${user}]]</li></ul></body></html>😀 Spring WebFlux😨 Spring MVC](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-112-2048.jpg&f=jpg&w=240)








![71ConcurrencyThroughput [trans / sec]Core i7 2.7 GHz4 Core x HT](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-121-2048.jpg&f=jpg&w=240)
























The document provides an introduction and overview of Spring WebFlux, a non-blocking web framework for Spring. It discusses the differences between blocking and non-blocking web stacks, and how Spring WebFlux uses reactive streams and programming. Code examples are provided showing how to build reactive controllers and streams in Spring WebFlux that support backpressure.
































![Reactor18Flux<String> s = Flux.just("a", "b", "c", "d").map(String::toUpperCase);s.log("demo").subscribe();Need to be subscribed!00:58:33.902 [main] INFO demo - | request(unbounded)00:58:33.903 [main] INFO demo - | onNext(A)00:58:33.903 [main] INFO demo - | onNext(B)00:58:33.903 [main] INFO demo - | onNext(C)00:58:33.903 [main] INFO demo - | onNext(D)00:58:33.903 [main] INFO demo - | onComplete()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-33-2048.jpg&f=jpg&w=240)

![Reactor19Flux<String> s = Flux.just("a", "b", "c", "d").map(String::toUpperCase).delayElements(Duration.ofSeconds(1));s.log("demo").subscribe();00:59:42.949 [main] INFO demo - request(unbounded)00:59:43.992 [parallel-1] INFO demo - onNext(A)00:59:44.994 [parallel-2] INFO demo - onNext(B)00:59:45.997 [parallel-3] INFO demo - onNext(C)00:59:46.999 [parallel-4] INFO demo - onNext(D)00:59:47.001 [parallel-4] INFO demo - onComplete()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-35-2048.jpg&f=jpg&w=240)






























![40$ curl -v -H "Accept: text/event-stream" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: text/event-stream>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: text/event-stream<data:{"text":"a"}data:{"text":"a"}data:{"text":"a"}...INFO 48330 --- [ctor-http-nio-2] message : request(1)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : request(31)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : request(24)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-2] message : request(24)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-2] message : onComplete()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-66-2048.jpg&f=jpg&w=240)
![40$ curl -v -H "Accept: text/event-stream" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: text/event-stream>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: text/event-stream<data:{"text":"a"}data:{"text":"a"}data:{"text":"a"}...INFO 48330 --- [ctor-http-nio-2] message : request(1)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : request(31)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : request(24)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-2] message : request(24)INFO 48330 --- [ctor-http-nio-2] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-2] message : onComplete()Backpressure](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-67-2048.jpg&f=jpg&w=240)

![(FYI) In case of Servlet Stack41INFO 61528 --- [nio-8080-exec-1] message : request(1)INFO 61528 --- [nio-8080-exec-1] message : onNext(a)INFO 61528 --- [ MvcAsync1] message : request(1)INFO 61528 --- [ MvcAsync1] message : onNext(a)INFO 61528 --- [ MvcAsync2] message : request(1)... ...INFO 61528 --- [ MvcAsync98] message : request(1)INFO 61528 --- [ MvcAsync98] message : onNext(a)INFO 61528 --- [ MvcAsync99] message : request(1)INFO 61528 --- [ MvcAsync99] message : onNext(a)INFO 61528 --- [ MvcAsync99] message : onComplete()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-69-2048.jpg&f=jpg&w=240)
![(FYI) In case of Servlet Stack41INFO 61528 --- [nio-8080-exec-1] message : request(1)INFO 61528 --- [nio-8080-exec-1] message : onNext(a)INFO 61528 --- [ MvcAsync1] message : request(1)INFO 61528 --- [ MvcAsync1] message : onNext(a)INFO 61528 --- [ MvcAsync2] message : request(1)... ...INFO 61528 --- [ MvcAsync98] message : request(1)INFO 61528 --- [ MvcAsync98] message : onNext(a)INFO 61528 --- [ MvcAsync99] message : request(1)INFO 61528 --- [ MvcAsync99] message : onNext(a)INFO 61528 --- [ MvcAsync99] message : onComplete()✅ Backpressure](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-70-2048.jpg&f=jpg&w=240)

![42$ curl -v -H "Accept: application/stream+json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/stream+json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/stream+json;charset=UTF-8<{"text":"a"}{"text":"a"}{"text":"a"}...INFO 48330 --- [ctor-http-nio-4] message : request(1)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : request(31)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : request(24)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-4] message : request(24)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-4] message : onComplete()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-72-2048.jpg&f=jpg&w=240)
![42$ curl -v -H "Accept: application/stream+json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/stream+json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/stream+json;charset=UTF-8<{"text":"a"}{"text":"a"}{"text":"a"}...INFO 48330 --- [ctor-http-nio-4] message : request(1)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : request(31)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : request(24)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-4] message : request(24)INFO 48330 --- [ctor-http-nio-4] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-4] message : onComplete()✅ Backpressure](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-73-2048.jpg&f=jpg&w=240)
![43$ curl -v -H "Accept: application/json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/json;charset=UTF-8<[{"text":"a"},{"text":"a"},...,{"text":"a"},{"text":"a"},{"text":"a"},{"text":"a"}]](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-74-2048.jpg&f=jpg&w=240)
![43$ curl -v -H "Accept: application/json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/json;charset=UTF-8<[{"text":"a"},{"text":"a"},...,{"text":"a"},{"text":"a"},{"text":"a"},{"text":"a"}]INFO 48330 --- [ctor-http-nio-3] message : request(unbounded)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onComplete()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-75-2048.jpg&f=jpg&w=240)
![43$ curl -v -H "Accept: application/json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/json;charset=UTF-8<[{"text":"a"},{"text":"a"},...,{"text":"a"},{"text":"a"},{"text":"a"},{"text":"a"}]INFO 48330 --- [ctor-http-nio-3] message : request(unbounded)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)... ...INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onNext(a)INFO 48330 --- [ctor-http-nio-3] message : onComplete()❌ Backpressure](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-76-2048.jpg&f=jpg&w=240)

![Flux -> Mono45@GetMapping("hello")public Mono<List<Message>> hello() {return Mono.just(new Message("a")).repeat().take(100).collectList().log("message");}$ curl -v -H "Accept: application/stream+json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/stream+json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/stream+json;charset=UTF-8<[{"text":"a"},{"text":"a"},...,{"text":"a"},{"text":"a"},{"text":"a"},{"text":"a"}]](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-78-2048.jpg&f=jpg&w=240)
![Flux -> Mono45@GetMapping("hello")public Mono<List<Message>> hello() {return Mono.just(new Message("a")).repeat().take(100).collectList().log("message");}$ curl -v -H "Accept: application/stream+json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/stream+json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/stream+json;charset=UTF-8<[{"text":"a"},{"text":"a"},...,{"text":"a"},{"text":"a"},{"text":"a"},{"text":"a"}]INFO 48330 --- [ctor-http-nio-3] message : | request(1)INFO 48330 --- [ctor-http-nio-3] message : | onNext([a, a, a, a,a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a,a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a,a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a])INFO 48330 --- [ctor-http-nio-3] message : | request(31)INFO 48330 --- [ctor-http-nio-3] message : | onComplete()](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-79-2048.jpg&f=jpg&w=240)
![Flux -> Mono45@GetMapping("hello")public Mono<List<Message>> hello() {return Mono.just(new Message("a")).repeat().take(100).collectList().log("message");}$ curl -v -H "Accept: application/stream+json" localhost:8080/messages> GET /messages HTTP/1.1> Host: localhost:8080> Accept: application/stream+json>< HTTP/1.1 200 OK< transfer-encoding: chunked< Content-Type: application/stream+json;charset=UTF-8<[{"text":"a"},{"text":"a"},...,{"text":"a"},{"text":"a"},{"text":"a"},{"text":"a"}]INFO 48330 --- [ctor-http-nio-3] message : | request(1)INFO 48330 --- [ctor-http-nio-3] message : | onNext([a, a, a, a,a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a,a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a,a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a])INFO 48330 --- [ctor-http-nio-3] message : | request(31)INFO 48330 --- [ctor-http-nio-3] message : | onComplete()❌ Backpressure](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-80-2048.jpg&f=jpg&w=240)





























![66<html><body><ul><li data-th-each="user : ${user}">[[${user}]]</li></ul></body></html>](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-110-2048.jpg&f=jpg&w=240)
![66<html><body><ul><li data-th-each="user : ${user}">[[${user}]]</li></ul></body></html>😀 Spring WebFlux](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-111-2048.jpg&f=jpg&w=240)
![66<html><body><ul><li data-th-each="user : ${user}">[[${user}]]</li></ul></body></html>😀 Spring WebFlux😨 Spring MVC](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-112-2048.jpg&f=jpg&w=240)








![71ConcurrencyThroughput [trans / sec]Core i7 2.7 GHz4 Core x HT](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2f2017-11-24-spring-webflux-171124064708%2f75%2fIntroduction-to-Spring-WebFlux-jsug-sf_a1-121-2048.jpg&f=jpg&w=240)






















