trace-demo
Spring Cloud Sleuth and Zipkin sample to demonstrate distributed tracing for Microservices
Startup Steps
- Install Zipkin
-
See instructions from http://zipkin.io/pages/quickstart
-
If you are using the default zipkin configuration the admin console will be available at http://localhost:9411
- The application consists of 4 SpringBoot applications
- TraceDemoApplication - Frontend
- CartService - Cart Microservice
- CustomerService - Customer management Microservice
- OrderService - Order Microservice
This is a simulation of a sequence of microservices being called for a cart checkout process
- The web application will submit a cart to initiate the checkout via the cartservice POST call
- The cart service then initiates a call to the order service to place the order and gets back an order ID
- The cart service then makes a subsequent call to the customer service to save the cart
- The updated cart is returned with the order id and the cart status
To run it from the command line execute the following steps on different command prompts
mvn spring-boot:run -Dmainclass=com.tfg.example.TraceDemoApplication
mvn spring-boot:run -Dmainclass=com.tfg.example.service.CartService
mvn spring-boot:run -Dmainclass=com.tfg.example.service.CustomerService
mvn spring-boot:run -Dmainclass=com.tfg.example.service.OrderService
Or use STS or IntelliJ to import the project and start each of these SpringBoot microservices
- Use Postman or the browser and execute the following URL
http://localhost:8080/cart-checkout
The response will be something like the one mentioned below (where the orderID is randomly generated by the OrderService)
{
"id": 1,
"lineItem": [
{
"id": 1,
"sku": "abc"
}
],
"orderId": "74493906-b46d-4155-aa1f-1c0c47c20260",
"checkedOut": true
}

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
