How to do it...

Date emissions in Streams are affected by the backpressure operations used to extract the data. Let us define some backpressure operations by doing the following steps:

  1. Create a separate service class, EmployeeBatchStreamservice that will showcase some abstract methods that will utilize time-related operators that are needed in setting up backpressure on Stream types:
public interface EmployeeBatchStreamservice {    
   public Mono<Employee> selectOneEmployee(); 
   public Flux<Employee> selectSomeEmpRecords(); 
   public Flux<List<Employee>> getEmployeesByBatch(); 
   public Flux<String>   getTimedFirstNames(); 
   public Flux<Employee> selectEmpDelayed(); 
   public Flux<Employee> getDeferredEmployees(); 
}
  1. The first event to implement is selectOneEmployee() ...

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.