Spring Cloud Microservices Tutorial Series
In this tutorial series, we will talk about the following topics that are used to develop microservices with Spring Cloud:
- Service Discovery
- Request routing
- Service-to-service calls
- Load balancing
- Distributed Tracing
- Circuit Breaker pattern
- Retrying service-to-service calls
We will develop 3 microservices to list users, list user orders, view order details etc:
User Service: Used to retrieve user details along with their orders. A sample user record looks like the following:
{
"id": 1,
"name": "Joe",
"orders": [
{
"id": 11,
"userId": 1,
"price": 1250,
"orderTime": "2022-10-11T11:41:44.085868100Z"
},
{
"id": 10,
"userId": 1,
"price": 100,
"orderTime": "2022-10-11T11:41:44.085868100Z"
}
]
}
Order Service: Used to retrieve previous orders of users. Order Service internally calls Product Service to get the product details for the purchased items. Order details for a specific order look like the following:
[
{
"id": 100,
"orderId": 10,
"productId": 1000,
"product": {
"id": 1000,
"name": "pencil",
"quantity": 500
},
"quantity": 3,
"unitPrice": 0.7
},
{
"id": 101,
"orderId": 10,
"productId": 1001,
"product": {
"id": 1001,
"name": "book",
"quantity": 100
},
"quantity": 1,
"unitPrice": 8
}
]
Product Service: Used to retrieve product details. A sample product record looks like the following:
{
"id": 1000,
"name": "pencil",
"quantity": 500,
"unitPrice": 0.7
}
Below are the list of tutorials in this series:
Part 1 — Service Discovery with Netflix Eureka
Part 2 — Integrating API Gateway
Part 3 — Using Feign for Simplifying REST Calls
Part 4 — Distributed Tracing with Sleuth and Zipkin
Part 5 — Implementing Circuit Breaker with Resilience4j
Part 6 — Implementing Retry with Resilience4j
Source Code
You can download the complete source code of this tutorial series from this link.