January 2018
Intermediate to advanced
414 pages
10h 29m
English
We have used ReactiveCrudRepository to perform CRUD operations in our database, but since we need to perform operations with reactive types, such as Mono or Flux, we need to use ReactiveMongoTemplate to handle this reactively.
So, we are going to change CustomerRepository to become a class that is annotated with @Repository:
package com.microservices.chapter5import org.springframework.data.mongodb.core.ReactiveMongoTemplateimport org.springframework.stereotype.Repositoryimport reactor.core.publisher.Mono@Repositoryclass CustomerRepository(private val template: ReactiveMongoTemplate) { fun create(customer: Mono<Customer>) = template.save(customer)}
A class annotated with the repository can receive a ReactiveMongoTemplate ...
Read now
Unlock full access