AI Instructor Live Labs Included

Microservices with Spring Boot and Docker

Build a 3-service e-commerce platform with Spring Boot, Resilience4j, Docker, and Docker Compose. Learn microservices architecture, circuit breakers, containerization, and multi-service orchestration.

Advanced
21h 35m
14 Lessons
SMU-JAVA-MICRO
Java Microservices with Spring Cloud Badge

View badge details

About This Course

Master microservices architecture by building ShopNest a 3-service e-commerce platform consisting of a Product Service, Order Service, and Notification Service. You will decompose a monolith into independent Spring Boot services, wire them together with REST communication, externalize configuration, add resilience patterns with Resilience4j circuit breakers, containerize each service with Docker multi-stage builds, and orchestrate the full stack with Docker Compose. By the end of this course you will have a production-ready, containerized microservices system that demonstrates bounded contexts, fault tolerance, and cloud-native deployment practices.

Course Curriculum

14 Lessons
01
AI Lesson
AI Lesson

Microservices Architecture Principles

1h 0m

Learn the foundational principles of microservices architecture — monolith vs microservices tradeoffs, bounded contexts, the ShopNest decomposition strategy, synchronous vs asynchronous inter-service communication, CAP theorem basics, and when NOT to adopt microservices.

02
Lab Exercise
Lab Exercise

Service Decomposition - Lab Exercises

2h 5m 4 Exercises

Build the ShopNest Product Service from a skeleton — add the Product JPA entity, ProductRepository, full CRUD REST endpoints, seed the H2 database, and verify the service returns data.

Add Fields to Product.java and Annotate with JPA ~20 min
Implement ProductController CRUD Endpoints ~20 min
Seed the H2 Database with data.sql ~20 min
Run the Product Service and Verify GET /api/products ~20 min
03
AI Lesson
AI Lesson

Inter-Service Communication with REST

1h 0m

Learn synchronous REST communication between microservices — RestTemplate vs WebClient, the DTO pattern to avoid domain coupling, HTTP error propagation between services, and the Order→Product call chain.

04
Lab Exercise
Lab Exercise

REST Communication - Lab Exercises

2h 5m 4 Exercises

Build the ShopNest Order Service — Order entity, ProductDto, RestTemplate bean, OrderCreationService with HTTP error handling, and a POST /api/orders endpoint that calls Product Service to validate stock before creating orders.

Create Order.java Entity and OrderRepository ~20 min
Add ProductDto and RestTemplate Bean ~20 min
Implement OrderCreationService with Error Handling ~20 min
Implement POST /api/orders and Test End-to-End ~20 min
05
AI Lesson
AI Lesson

Service Discovery and Configuration

1h 0m

Why hardcoded URLs break in production, externalizing application.properties, @Value vs @ConfigurationProperties, environment variable injection, and Spring Cloud Config basics.

06
Lab Exercise
Lab Exercise

Service Discovery - Lab Exercises

2h 5m 4 Exercises

Extract all service URLs and timeouts into application.properties, bind them with @ConfigurationProperties, and verify both services still communicate correctly.

Add services.product.url and timeout-ms to application.properties ~20 min
Create ProductServiceProperties with @ConfigurationProperties ~20 min
Inject ProductServiceProperties into OrderCreationService ~20 min
Configure Timeout-Aware RestTemplate and Verify Order Flow ~20 min
07
AI Lesson
AI Lesson

Resilience — Circuit Breakers and Retries

1h 0m

Why distributed systems fail, Resilience4j circuit breaker states (CLOSED/OPEN/HALF_OPEN), @CircuitBreaker and @Retry annotations, fallback methods, and bulkhead patterns.

08
Lab Exercise
Lab Exercise

Resilience - Lab Exercises

2h 5m 4 Exercises

Add Resilience4j to Order Service — @CircuitBreaker and @Retry on the Product Service call, fallback method, YAML configuration of thresholds, and observing circuit state transitions.

Add Resilience4j Dependencies to pom.xml ~20 min
Annotate getProduct() with @CircuitBreaker and @Retry ~20 min
Implement getProductFallback and Configure application.yml ~20 min
Observe Circuit Opening and Recovery ~20 min
09
AI Lesson
AI Lesson

Containerizing Spring Boot with Docker

1h 0m

Why containers solve the "works on my machine" problem, Docker image layers, multi-stage Maven builds, EXPOSE vs port binding, environment variable injection, and .dockerignore.

10
Lab Exercise
Lab Exercise

Docker - Lab Exercises

2h 5m 4 Exercises

Write Dockerfiles for all three ShopNest services using multi-stage Maven builds, create .dockerignore files, build images, and verify each service runs as a standalone container.

Write Dockerfile for product-service ~20 min
Build and Run product-service Container ~20 min
Write Dockerfiles for order-service and notification-service ~20 min
Verify All Three Containers Run Independently ~20 min
11
AI Lesson
AI Lesson

Multi-Service Orchestration with Docker Compose

1h 0m

Docker Compose YAML structure, service naming and DNS resolution, depends_on with health checks, named volumes for MySQL persistence, environment variable substitution, and docker-compose.override.yml.

12
Lab Exercise
Lab Exercise

Docker Compose - Lab Exercises

2h 5m 4 Exercises

Write docker-compose.yml wiring all three ShopNest services, implement NotificationPoller with @Scheduled, configure MySQL as the backing store, and verify the full stack with docker compose up.

Write docker-compose.yml with All Four Services ~20 min
Add depends_on Health Check and MySQL Init Script ~20 min
Implement NotificationPoller with @Scheduled ~20 min
Run docker compose up and Verify the Full Stack ~20 min
13
AI Lesson
AI Lesson

Capstone Briefing

1h 0m

Review of all course concepts — bounded contexts, REST communication, config externalization, Resilience4j, Docker multi-stage builds, Docker Compose orchestration. Capstone project requirements: add a discount-service to the ShopNest stack.

14
Lab Exercise
Lab Exercise

Capstone Project

2h 5m 4 Exercises

Build and integrate a fourth discount-service into the ShopNest platform — scaffold the service, containerize it, update Order Service to call it with a circuit breaker, add it to Docker Compose, and verify the full four-service stack.

Scaffold discount-service with DiscountController ~20 min
Write Dockerfile for discount-service ~20 min
Update order-service to Call discount-service with @CircuitBreaker ~20 min
Add discount-service to docker-compose.yml and Run the Full Stack ~20 min

This course includes:

  • 24/7 AI Instructor Support
  • Live Lab Environments
  • 7 Hands-on Lessons
  • 6 Months Access
  • Completion Badge
  • Certificate of Completion
Java Microservices with Spring Cloud Badge

Earn Your Badge

Complete all lessons to unlock the Java Microservices with Spring Cloud achievement badge.

Category
Skill Level Advanced
Total Duration 21h 35m
Java Microservices with Spring Cloud Badge
Achievement Badge

Java Microservices with Spring Cloud

Awarded for completing the Java Microservices course, demonstrating mastery of microservice architecture with Spring Cloud, service discovery, and distributed systems.

Course Microservices with Spring Boot and Docker
Criteria Complete all lessons and pass assessments in the Java Microservices with Spring Cloud course.
Valid For 730 days

Skills You'll Earn

Microservices Architecture Spring Cloud Service Discovery API Gateway Circuit Breaker Distributed Configuration

Complete all lessons in this course to earn this badge