In this implementation contain two services in the hypothetical scenario on the reservation domain. Booking-service work as a backend-for-frontend service and user request hits directly to the booking-service when booking request raises two inter-services communication happens from booking-service to host-management-service and verify the availability of host and make booking calls.
- Java 1.8+
- Maven 2+
Go to /booking-service directory and run.
mvn clean install
java -jar target/booking-service-0.0.1-SNAPSHOT.jar
Go to /host-management-service directory and run.
mvn clean install
java -jar target/host-management-service-0.0.1-SNAPSHOT.jar
You can spin up the Zipkin instance using three options: using Java, Docker, or running from source. In this demo, I prefer to fetch the latest release as a self-contained executable jar.
curl -sSL https://zipkin.io/quickstart.sh | bash -s
java -jar zipkin.jar
Once spin up all three services. You can run the POST request and see how request trace via Zipkin visualization tool.
curl -X POST \
[http://localhost:8080/booking](http://localhost:8080/booking) \
-H ‘content-type: application/json’ \
-d ‘{
“bookingID” : 1,
“bookingDate” : “2022–02–19T00:00:00.000Z”,
“host” : {
“hostID” : 10
}
}’
End Point : http://localhost:9411/