The Wayback Machine - https://web.archive.org/web/20201202210311/https://github.com/ERS-HCL/trace-demo
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

trace-demo

Spring Cloud Sleuth and Zipkin sample to demonstrate distributed tracing for Microservices

Startup Steps

  1. Install Zipkin
  1. 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

  1. The web application will submit a cart to initiate the checkout via the cartservice POST call
  2. The cart service then initiates a call to the order service to place the order and gets back an order ID
  3. The cart service then makes a subsequent call to the customer service to save the cart
  4. 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

  1. 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
}

Screen shots from Zipkin

Screenshot 1

Screenshot 2

Screenshot 3

About

Spring Cloud Sleuth and Zipkin sample to demonstrate distributed tracing for Microservices

Topics

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.