rx-javareactive-programmingspring-webfluxproject-reactor

Java Spring WebFlux vs RxJava


I’m starting to learn reactive programming in Java. The whole reactive paradigm is new to me.

In my learning process, i have come across few terms/libraries such as Spring WebFlux, projectreactor, and RxJava. I hope someone can explain what the differences are, and which one you used for your project and why you have made this choice.

I read that Spring WebFlux actually uses projectreactor's Flux/Mono internally. This simplified the question to pros and cons of Spring Webflux over RxJava?


Solution

  • In general, RxJava support project which based on JDK8- and Project Reactor supports JDK 8+. But for a beginner, you can learn RxJava at first. Since Project Reactor you can consider it fix the drawbacks in RxJava and more suitable for Backend development. RxJava has too many problems which can cause Out of Memory if you can't use it well. But in final, if you want to use Spring 5.2+ very well, you need to learn from RxJava->Reactor->NIO->Netty->Reactor netty.