Micronaut-core: Move from RxJava 2 to Reactor for Micronaut 3

Created on 2 Nov 2020  路  5Comments  路  Source: micronaut-projects/micronaut-core

This is up for discussion, but I strongly believe we should consider moving from RxJava 2 to Reactor for Micronaut 3 for the following reasons:

  • Context propagation is built into a Reactor in a way that does not require thread locals and complex, error prone instrumentation
  • R2DBC drivers are implemented in Reactor
  • It will be easier for Spring Developers to use Micronaut
  • RxJava 3 is out now and we have to make a breaking change anyway if we were to upgrade so I think we should just consider using Reactor instead
  • Reactor is more stable now and a better fit for the server side

In terms of how this transition would play out, we would rewrite the internals of Micronaut to use Reactor instead of RxJava but continue to expose the existing Rx* interfaces in a backwards compatible way but instead in a new micronaut-rxjava2 subproject thus there would be likely minimal breaking changes from a user perspective.

Same would happen for the existing micronaut-rxjava3 project

We would then rewrite much of instrumentation logic to use reactor context propagation and provide instructions on what to do if you engage RxJava code.

next major version

Most helpful comment

A decision has been made and Micronaut will move to Reactor in 3.0

All 5 comments

Yes please!!! I've actually abandoned reactive code in most of my Micronaut services because I've been hit by so many weird problems with context propagation. I came from Spring Boot / Reactor and my feeling is that everything reactive there just worked (IMO).

I'm curious if the decision has been made? Any news about that?

Will be discussed soon

A decision has been made and Micronaut will move to Reactor in 3.0

Great! I believe it's a good decision.

Was this page helpful?
0 / 5 - 0 ratings