Integrating Spring Boot Reactive MongoDB Starter

To connect to the ReactiveMongo database, Spring Boot provides a starter project--Spring Boot Reactive MongoDB Starter. Let's add this to our the pom.xml file:

    <dependency>      <groupId>org.springframework.boot</groupId>      <artifactId>spring-boot-starter-data-mongodb-        reactive</artifactId>    </dependency>

The spring-boot-starter-data-mongodb-reactive starter brings in the spring-data-mongodb, mongodb-driver-async, and mongodb-driver-reactivestreams dependencies. The following snippet shows the important dependencies in the spring-boot-starter-data-mongodb-reactive starter:

    <dependency>      <groupId>org.springframework.data</groupId>      <artifactId>spring-data-mongodb</artifactId>      <exclusions> <exclusion> ...

Get Mastering Spring 5.0 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.