January 2018
Intermediate to advanced
414 pages
10h 29m
English
We can now modify our service to return a publisher for the list of customers through a Flux. First, we need to modify our service interface, CustomerService:
package com.microservices.chapter4import reactor.core.publisher.Fluximport reactor.core.publisher.Monointerface CustomerService { fun getCustomer(id: Int) : Mono<Customer?> fun searchCustomers(nameFilter: String): Flux<Customer>}
Then, we will modify our CustomerServiceImpl class:
package com.microservices.chapter4import com.microservices.chapter4.Customer.Telephoneimport org.springframework.stereotype.Componentimport reactor.core.publisher.toFluximport reactor.core.publisher.toMonoimport java.util.concurrent.ConcurrentHashMap@Componentclass CustomerServiceImpl ...
Read now
Unlock full access