This last recipe will show us how Spring 5 can integrate with other Reactive Stream implementation such as RxJava 2.0:
- 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>
- 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> ...