Browse Source

Deprecate support for RxJava 1.x

Closes gh-19628
pull/25049/head
Rossen Stoyanchev 5 years ago
parent
commit
a64e7091e0
  1. 5
      spring-core/src/main/java/org/springframework/core/ReactiveAdapterRegistry.java
  2. 9
      src/docs/asciidoc/web-reactive.adoc

5
spring-core/src/main/java/org/springframework/core/ReactiveAdapterRegistry.java

@ -48,6 +48,9 @@ import org.springframework.util.ReflectionUtils; @@ -48,6 +48,9 @@ import org.springframework.util.ReflectionUtils;
* {@link CompletableFuture}, Java 9+ {@code Flow.Publisher}, and Kotlin
* Coroutines' {@code Deferred} and {@code Flow}.
*
* <p><strong>Note:</strong> As of Spring Framework 5.3, support for RxJava 1.x
* is deprecated in favor of RxJava 2 and 3.
*
* @author Rossen Stoyanchev
* @author Sebastien Deleuze
* @since 5.0
@ -77,7 +80,7 @@ public class ReactiveAdapterRegistry { @@ -77,7 +80,7 @@ public class ReactiveAdapterRegistry {
}
this.reactorPresent = reactorRegistered;
// RxJava1
// RxJava1 (deprecated)
if (ClassUtils.isPresent("rx.Observable", classLoader) &&
ClassUtils.isPresent("rx.RxReactiveStreams", classLoader)) {
new RxJava1Registrar().registerAdapters(this);

9
src/docs/asciidoc/web-reactive.adoc

@ -57,7 +57,14 @@ For annotated controllers, WebFlux transparently adapts to the reactive library @@ -57,7 +57,14 @@ For annotated controllers, WebFlux transparently adapts to the reactive library
the application. This is done with the help of the
{api-spring-framework}/core/ReactiveAdapterRegistry.html[`ReactiveAdapterRegistry`], which
provides pluggable support for reactive library and other asynchronous types. The registry
has built-in support for RxJava and `CompletableFuture`, but you can register others, too.
has built-in support for RxJava 2/3, RxJava 1 (via RxJava Reactive Streams bridge), and
`CompletableFuture`, but you can register others, too.
[NOTE]
====
As of Spring Framework 5.3, support for RxJava 1 is deprecated.
====
For functional APIs (such as <<webflux-fn>>, the `WebClient`, and others), the general rules
for WebFlux APIs apply -- `Flux` and `Mono` as return values and a Reactive Streams

Loading…
Cancel
Save