October 2018
Intermediate to advanced
556 pages
15h 18m
English
Despite the fact that WebFlux uses Project Reactor 3 as the central building block, WebFlux allows the use of other reactive libraries as well. To enable cross-library interoperability, most operations in WebFlux are based on interfaces from the Reactive Streams specification. In this way, we can easily replace code written in Reactor 3 with RxJava 2 or Akka Streams:
import io.reactivex.Observable; // (1)... //@RestController // (2)class AlbomsController { // final ReactiveAdapterRegistry adapterRegistry; // (2.1) ... // @GetMapping("/songs") // (3) public Observable<Song> findAlbomByArtists( // (3.1) Flux<Artist> artistsFlux // (3.2) ) { Observable<Artist> observable = adapterRegistry // (4) .getAdapter(Observable.class) ...
Read now
Unlock full access