Skip to content

shoresea/webflux-demo

Repository files navigation

shoresea/webflux-demo status

Spring WebFlux Demo

This project is an example of a reactive micro-service developed using Spring WebFlux. It also has a Server-Side Event example. (Try at http://localhost:8080/index.html after running this demo on your local machine)

Run

./gradlew clean build
./gradlew bootRun

Endpoints

Get all products

curl --request GET \
  --url http://localhost:8080/products

Get product by ID

curl --request GET \
  --url http://localhost:8080/products/{id}

Add product

curl --request POST \
  --url http://localhost:8080/products \
  --header 'content-type: application/json' \
  --data '{
	"name": "Black Tea with Milk",
	"price": 3.49
}'

Update product

curl --request PUT \
  --url http://localhost:8080/products/{id} \
  --header 'content-type: application/json' \
  --data '{
	"name": "Black Tea with Milk",
	"price": 3.99
}'

Delete product

curl --request DELETE \
  --url http://localhost:8080/products/{id}

Delete all products

curl --request DELETE \
  --url http://localhost:8080/products

Get product event Stream

curl --request GET \
  --url http://localhost:8080/products/events

About

A reactive non-blocking micro-service example

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published