Skip to content

Building Reactive Rest Service with Spring WebFlux and Web Client consumer of that Service

Notifications You must be signed in to change notification settings

batuhaniskr/spring-webflux-reactive-rest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spring Webflux Reactive Rest

Building Reactive Rest Service with Spring Flux.

This Project based on the Spring 5/Spring Boot 2.0 and functional programming model.

Uses these packages:

  • Spring Webflux
  • Reactive-Mongo
  • Spring 5
  • Spring Boot 2.0

Requirements

  • Java 1.8
  • MongoDB

Database name is hotels_db and collection name is hotels.

Installation

1. Clone the application.

git clone https://github.com/batuhaniskr/spring-webflux-reactive-rest.git 

2. Build and run the server application using maven

MongoDB needs to be run.

sudo mongod
mvn clean install
mvn spring-boot:run

Application runs from http://localhost:8080/hotels

Example Commands

Create Hotels

 curl -X POST   http://localhost:8080/hotels  -H 'content-type: application/json' -d '{
    "name": "Konak Hotel",
    "address": "Çanakkale/Turkey",
    "createdAt": "2018-01-01"
}' 
 curl -X POST   http://localhost:8080/hotels  -H 'content-type: application/json' -d '{
    "name": "Balıklı Hotel",
    "address": "Balıkesir/Turkey",
    "createdAt": "2018-01-01"
}' 

Get All Hotels

curl http://localhost:8080/hotels 

Get a Hotel by id

curl http://localhost:8080/hotels/5a8d829cbb99221d55b5a221

Update a Hotel

 curl -X PUT http://localhost:8080/hotels/5a8d83b9bb99221d55b5a222 -H 'content-type: application/json' -d '{
"name":"ErzurumHotel",
"address":"Erzurum/Turkey",
"createdAt":"2018-01-01"
}'

About

Building Reactive Rest Service with Spring WebFlux and Web Client consumer of that Service

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages