The quote-service must be running on port 8080 before starting this consumer.
In a separate terminal:
cd ../03-quote-service
./mvnw spring-boot:runVerify it's running:
curl http://localhost:8080/api/random./mvnw spring-boot:runThe consumer starts on port 8081 (configured in application.properties).
curl http://localhost:8081/quoteYou should see a JSON response like:
{
"type": "success",
"value": {
"id": 3,
"quote": "Spring Boot is the best thing that has happened to Java development in a long time."
}
}| Service | Port |
|---|---|
| quote-service | 8080 |
| consuming-rest | 8081 |
curl :8081/quote ’ consumer ’ :8080/api/random ’ provider ’ JSON ’ consumer ’ JSON back