This is a sample application using Spring Boot 2 with Spring Webflux.
In order to get started with this sample application you need to install JDK 9. You can use SDKMAN! for that if you want.
The application need a running MongoDB instance, the easiest way to start one, is through docker
docker run --name some-mongo mongoThen you need to get the IP address of the mongo container
docker inspect --format '{{ .NetworkSettings.IPAddress }}' some-mongoIf the IP address is not 172.17.0.2, then you must change the IP address specified in the file src/main/resources/application-local.yml under the key spring.data.mongodb.host
spring:
data:
mongodb:
host: 172.17.0.2In order to start the sample application just call
./gradlew bootRunor on Windows
./gradlew.bat bootRunYou can use an IDE to look at the source code, I recommend the Spring Tool Suite, but you use any IDE that you see fit.
These example requests are issued through HTTPie.
http -v -a user:user :8080/customers/http -v -a user:user :8080/customers/ size==2 page==1http -v -a user:user :8080/customers/5acb629d859c16689db5f091http -v -a admin:admin POST :8080/customers/ firstName=Daenerys lastName=Targaryenhttp -v -a admin:admin DELETE :8080/customers/5ae2ef2a7593241a65e2b961http --stream -v -a user:user :8080/customers/stream 'Accept: text/event-stream'