Spring Tips: Functional Reactive Endpoints with Spring Framework 5.0

SpringDeveloper · 26K views · 2016 · 30:29

Open on YouTube

Web developmentSoftware architecture & designtutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as a worked example when asking or answering questions about early Spring 5 WebFlux, Flux/Mono endpoints and Netty server setup.

Recommended by 1 people across 1 different months, 2016 to 2017.

What it is

A 30-minute Spring Tips episode in which Josh Long walks through the then-new functional reactive endpoints in Spring Framework 5.0, built on Reactor and Netty. It is a live-coding style demo from the official SpringDeveloper channel, recorded during the Spring 5 milestone period.

What people said

Recommends Adit A. Pillai · 2017-06 · Stack Overflow · on “How to continuously stream data to the client in rxjava?”

I was able to come up with a solution to my question by following Spring Tips: the Spring Web Flux Reactive Client [LINK] Since, there is no javadoc available (yet) for the new WebFlux component of Spring 5 as it is not finalized yet (mentioned by M. Deinum, in his comments), it is not really possible to get to a proper solution unless someone is patient enough to play around with the different methods provided by various classes. Following links can be used for further viewing and references: WebFlux Framework- spring doc [LINK] Spring Tips: Functional Reactive Endpoints with Spring Framework 5.0 [this video] P.S. Please feel free to edit and update the answer, if you find better links and tutor

Cites MrPlow · 2016-11 · Stack Overflow · on “Netty HttpServer api changed/differs from available examples”

Netty server instantiation in Arjen Poutsma's blog post [LINK] and Josh Long's video example [this video] is done by creating an reactor.ipc.netty.http.HttpServer instance and then calling it's start or startAndAwait method with an ReactorHttpHandlerAdapter instance as an argument. However the API seems to have changed as now start and startAndAwait methods now expect a lambda with the following signature: java.util.function.Function<? super reactor.ipc.netty.http.HttpChannel,? extends org.reactivestreams.Publisher<java.lang.Void>> Project dependencies and their versions are the same as in Arjen Poutsma's example project <dependency> <groupId>org.reactivestreams</groupId> <artifactId>reactive-str

Cites intelectuallychallenged · 2016-12 · Stack Overflow · on “Benefits of having HTTP endpoints return Flux/Mono instances instead of DTOs”

I've watched Spring Tips: Functional Reactive Endpoints with Spring Framework 5.0 [this video] and read a little about spring reactor but I can't quite understand it. What are the benefits of having endpoints return Flux / Mono instances (jacksonified) instead of straight up dto objects (jacksonified), given that I've got netty and spring reactor active? I initially assumed that reactive streams would, in http request/response context, work more like websockets wherein the server pushes the data to the receiver with an open channel but this doesn't seem to be the case. Also what does netty actually do better in reactive programming than tomcat? I'm sorry if these questions seem stupid but I don't