Search code examples
reactor

reactor-v1.x.x Vs reactor-v2.x.x


We are evaluating reactor library for using it in our project. Our project was backed by spring context. So we needed a tool to build event-driven application which has the spring support.

Also our main area of focus was on ability to composing sequence of asynchronous events (Streams & Promises). In certain other use cases we might be in need of publisher/subscriber model or running long running processes asynchronously.

As I was evaluating, I noticed some of the following the latest released reactor-spring version is v1.1.3 with dependency on reactor-v1.1.3 which we could use.

But I also noticed the there’s reactor-v.2.0.0 (under development) which had quite a bit of changes especially in the area of Streams and Promises.

Please suggest me if it is a good idea for going with reactor-v1.1.3 with spring support or should we wait for reactor-v2.0 if we have to use more of Streams and Promises.

If we go ahead with reactor-v1.1.3.RELEASE how much code changes might be needed to get ourselves upgraded to v2.0.0.

I also wanted to check if we have any branch of ‘reactor samples’ for reactor-v1.1.3/v1.1.4. As of now I could see only one master branch available which has been updated to use reactor-v2.0.

Do we have the reactor API for latest release v1.1.4. Currently the API (https://reactor.github.io/docs/api/) points to Reactor 1.1.0 Release.

Where can I find the reactor-core-2.0.0 codebase? I am finding difficult to locate.

As I am new to this library, please feel free to correct me if any of my mentioned points/questions were incorrect. Thanks.


Solution

  • If you're starting new development, definitely go with Reactor 2.0. It's mainly the substantial improvements in the Stream and Promise APIs which resulted in having to bump the major version number. Differences in the rest of the codebase are pretty minimal. Converting between 1.1 code and 2.0 code requires some package renaming and a few tweaks here and there (like eliminating the use of the Deferred object in Stream 1.1).

    The other major change that justifies a major point release bump is the implementation of the Reactive Streams specification. It's out of the scope of this question to discuss it further but it is an important part of Reactor moving forward. Being able to natively integrate with Akka Streams, Ratpack, RxJava, and other libraries that already (or will shortly) implement Reactive Streams is a huge benefit to Reactor 2.0.

    The reactive-streams branch contains the code for Reactor 2.0. M1 is coming shortly and we'll start the process of updating the samples, though as you've noticed, some components like Spring support have already had to be bumped to Reactor 2.0 since they're relied on in some major almost-production applications.