How to do it...

This last recipe will show us how Spring 5 can integrate with other Reactive Stream implementation such as RxJava 2.0:

  1. In order for our Spring 5 platform to work perfectly with RxJava, add the following Maven dependencies to the pom.xml configuration:
<dependency> 
<groupId>io.Reactivex.rxjava2</groupId> 
<artifactId>rxjava</artifactId> 
<version>2.1.0</version> 
</dependency> 
  1. Create a service class EmployeeRxJavaService that contains the following template methods summarizing all RxJava events:
public interface EmployeeRxJavaService { public Observable<Employee> getEmployeesRx(); public Single<Employee> getEmployeeRx(int empid); public Flowable<String> getFirstNamesRx(); public Flowable<String> getEmpNamesRx(); public Flowable<String> ...

Get Spring 5.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.