We are evaluating reactive programming frameworks for one of our projects. I just went through vert.x tutorials. I checked RxJava presentation a bit. RxJava seemed more close to CompletableFuture. But despite the underlying patterns, both RxJava and Vert.x give access to non blocking programming. I am confused as to what is the difference between them. I will appreciate any help in this regard.
RxJava is a Java library that enables Functional Reactive Programming in Android development. It raises the level of abstraction around threading in order to simplify the implementation of complex concurrent behavior.
RxJava is a Java implementation of ReactiveX. The ReactiveX (or Reactive Extensions) project aims to provide a reactive programming concept. It's a combination of the Observer pattern, the Iterator pattern, and functional programming.
RxJava, once the hottest framework in Android development, is dying. It's dying quietly, without drawing much attention to itself. RxJava's former fans and advocates moved on to new shiny things, so there is no one left to say a proper eulogy over this, once very popular, framework.
RxJava is a Java VM implementation of Reactive Extensions: a library for composing asynchronous and event-based programs by using observable sequences.
VertX is a server framework for asynchronous servers while RxJava is a framework for asynchronous computations. VertX has support for RxJava and many use them together.
If you are going to create a web application and want a scalable backend, use VertX, possibly with RxJava. But if you are on another platform, just use RxJava.
Read more about using VertX and RxJava together at Vert.x API for RxJava
From their own site:
Eclipse Vert.x is a toolkit for building reactive applications on the JVM.
It defines the fundamental APIs for writing asynchronous networked applications (eg: db connection, monitoring, authentication, service discovery, clustering, etc.)
Internally, it is based on the Netty project, a high-performance asynchronous networking library for the JVM. However, it provides a higher-level API easier to reason with and still highly performant.
You can use Vert.x callback-based API exclusively but Vert.x also implements an equivalent Rxified API using RxJava under the hood. This provides a great platform to integrate Vert.x modules within RxJava applications.
Vert.x is polyglot as it supports many other JVM based languages APIs such as Kotlin, Groovy, Ruby, Scala, and Ceylon. Moreover, since Vert.x is event-driven and message based, it also provides a JavaScript API quite useful to integrate frontend with backends.
Vert.x provides fluent HTTP endpoints and route configuration backed by handlers where the business logic is implemented. But the real nervous system is the event bus that acts as a telecom provider to all Vert.x local or distributed components.
This very event-bus supports:
The event-bus is supported by:
Cluster managers such as Hazelcast, InfiniSpan, Ignite or ZooKeeper that provides distributed Maps, Locks, and Counters through a higher-level API access
Vert.x service discovery API providing an address based abstraction to underlying complex addressing schemes
SSL capable TCP service access points for bi-directional secured communication and maximum performance
Finally, Vert.x can be used by itself to develop a full-blown application or used collaboratively with frameworks such as SpringBoot, Fibers, etc.
More details here, here and here.
Hope this helps,
Softjake
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With