RxJava 1 -> RxJava 2 (Understanding the Changes)
Article Summary
RxJava 2 was a complete rewrite with breaking APIs. If you're still on version 1, here's what changed and why it matters.
Kaushik Gopal breaks down the RxJava 1 to 2 migration in this technical guide. The rewrite wasn't arbitrary: RxJava 2 now implements the Reactive Streams specification, making interop between reactive libraries much easier.
Key Takeaways
- Flowable replaces Observable as your default: it's Observable plus backpressure handling
- Reactive Streams spec has just 4 interfaces: Publisher, Subscriber, Subscription, Processor
- Package changed from rx to io.reactivex, gradle dependencies need '2' suffix
- Observable still exists but for specialized use cases only
- Don't run RxJava 1 and 2 simultaneously: backpressure behavior differs drastically
Critical Insight
RxJava 2's adoption of Reactive Streams standardization means better library interop, but requires understanding the Flowable vs Observable distinction.