This is a simple message echoing REST service, includes the following points:
- Demotrate the basic usage of Spring WebFlux.
- Show case the usage of service and log tracing by utilizing Spring Cloud Sleuth.
- Experiment on logging the full inbound and outbound HTTP request & response, including HTTP start/status line, headers, and full body.
- To launch the application as a standalone service (at http://localhost:8080), use the
soleprofile, for example:ORjava -jar echo-rx-rest-api-1.0.0-SNAPSHOT.jar --spring.profiles.active=solemvn spring-boot:run -Dspring-boot.run.profiles=sole - To launch the application instances to form a simplified/minified microservices example, use the
mainandsubprofile, for example:
-
For the main service (at http://localhost:8080):
java -jar echo-rx-rest-api-1.0.0-SNAPSHOT.jar --spring.profiles.active=mainOR
mvn spring-boot:run -Dspring-boot.run.profiles=main -
For the sub service (at http://localhost:8081):
java -jar echo-rx-rest-api-1.0.0-SNAPSHOT.jar --spring.profiles.active=subOR
mvn spring-boot:run -Dspring-boot.run.profiles=sub
- In the standalone mode, the service echoes the
inputmessage with messageSOLE::input; - In the sub-service mode, the service echoes the
inputmessage with messageSUB::input; - In the main-service mode (assuming the sub-service is working), the service echoes the
inputmessage with messageMAIN::SUB::input.