Skip to content

dassiorleando/spring-reactive-mongodb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-reactive-mongodb

Demo project for Spring Boot(Spring 5), Reactive Web and Reactive Data MongoDB

Prerequisites

  • JDK 1.8+
  • MongoDB installed

Resources

Reactive Web

Spring-webflux alongside with Reactor Netty and Reactive-Stream enabling reactive capabilities to the entire stack:

  • Non-Blocking network operations on the jvm
  • Support for asynchronous stream processing with non-blocking backpressure

Reactive Data Mongo

Providing interface to interact with Spring Data Mongo in a reactive way, here we're using:

  • ReactiveMongoRepository in lieu of MongoRepository
  • ReactiveMongoTemplate and not MongoTemplate as before Spring 5
  • EnableReactiveMongoRepositories instead of EnableMongoRepositories
  • AbstractReactiveMongoConfiguration and not AbstractMongoConfiguration

Tasks list

  • Core files with spring-boot
  • MongoDB configurations
  • Article's Model, Repository and Service
  • Article's CRUD operations
  • Build a reactive rest API with Annotation-based Programming Model
  • Article rest service tests
  • Refactor the API to use a Functional Programming Model(HandlerFunction + RouterFunction)

Run

  1. Start mongod process
  2. ./mvnw clean install
  3. ./mvnw spring-boot:run