Closed danjee closed 7 years ago
How do you see this marriage from integration point of view? What value brings RxJava for Pippo?
RxJava
/ Spring's Reactor
biggest value is when you have many asynchronous operation happening and you need a clear flow on how to handle and merge the responses. This ties to calling many microservices endpoints to service a user's request.
Short parenthesis RxJava is active in the Android land(with GUI callbacks being the async ops) while for enterprise Java developers I think Spring Reactor will be a bigger deal as Spring seems to have invested more time(and money as they hired developers who work full time on Spring Reactor). The focus on reactive with spring-web-reactive, spring-data with reactive repos, spring-kafka, etc (being major features they have planned for Spring5). Btw RxJava and Spring reactor-core are very very similar in the API and how they work.
But notice that to get the full value of a reactive service they do deploy the spring-web-reactive services into RxNetty or ReactorNetty servers.
Still this is not a show stopper for pippo, because we can use RxJava with no problem to call backend microservices or reactive repositories inside the GET,POST methods. In the end to switch back from reactive to a blocking world with the .toBlocking()
operator to wait for the reactive services and serve the web page as you normally would with context.render()
. But being Servlet based(one-thread-per-reques), with pippo we don't have the benefit of non-blocking webframeworks(fewer resources for a large number of users).
Ratpack framework is also reactive web framework designed from the start and doesn't follow the Servlet specs and only runs on Netty.
Also with jdk 9 they try to standardize this with the Flow API. Like Șerban said Spring 5 will add a bunch of new capabilities supporting this: Functional web framework
Hello, What do you think about adding RxJava into the scene?