January 2018
Intermediate to advanced
414 pages
10h 29m
English
Previously, we have created a service class to hide the implementation details how we persist in our Model, so let's do it again by creating a CustomerService interface, for now, just a method to get a Customer from an id:
package com.microservices.chapter5import reactor.core.publisher.Monointerface CustomerService { fun getCustomer(id: Int): Mono<Customer>}
Now, we will create the implementation of the service:
package com.microservices.chapter5import reactor.core.publisher.Monoclass CustomerServiceImpl : CustomerService { override fun getCustomer(id: Int): Mono<Customer> { }}
We now need to add a READ operation to our repository to get a customer:
package com.microservices.chapter5import org.springframework.data.mongodb.core.ReactiveMongoTemplate ...
Read now
Unlock full access