After the synchronous repository methods, this recipe will showcase the Spring 5 support for Reactive Spring Data JPA repositories. If you are expecting that this recipe will be used for relational databases, this Reactive Spring Data JPA is feasible only for NoSQL databases such as MongDB and Couchbase, and not with MySQL and other relational databases.
Create another Maven project, ch12-mongodb
, that will be used to implement the Reactive Spring Data JPA with a MongoDB database.
Let us utilize Reactive Spring Data JPA by performing the following steps:
- Convert
ch12-mongodb
to a Spring Boot 2.0 application by adding the Spring Boot 2.0.0.M2 starter POM dependencies, such aswebflux
,actuator
for project status monitoring and management, Spring JDBC, MySQL connector, and the Spring Data JPA starter POM that we just used.