
Build resilient Spring Cloud microservices using Spring Boot, Hibernate, and openfeint for inter-service communication. Learn to apply Spring Cloud Gateway, Sleuth, and Zipkin for performance monitoring and fault-tolerant architectures.
Create microservices from scratch with MySQL and REST APIs. Include validation, exception handling, inter-service calls with web client and Openfeint, and discovery with Eureka and Spring Cloud Gateway routing.
Explore how a gateway load balances and forwards requests from the user interface to the employee and department microservices, with a config server and Eureka registry.
Learn to set up the eclipse-based Sprint Alsoat IDE with the spring tool suit, then install Lombok to generate getters, setters, and constructors via the Lombok jar and installer.
Import data to a MySQL database using a self-contained script downloaded from GitHub, then import the file in MySQL Workbench and verify the ipdb schema with department and employee tables.
Create the employee service by bootstrapping a Spring starter project with Maven, configuring group and package, and adding Spring Web, DevTools, Spring Data JPA, and Lombok for a MySQL-backed microservice.
Connect the employee service to the MySQL database by configuring the data source url, username, and password, then launch the microservice to run on port 8080.
Create the employee entity in the employee service with id, first name, last name, dept id, and birth date; annotate with JPA and Lombok, and define EmployeeRepository extending JpaRepository.
Introduce the employee DTO and a Spring service, rename the employee class to a DTO, remove the entity annotation, and implement getAllEmployees returning an empty list for controller and repository.
Create an employee controller, annotate it as a rest controller, map the api employees endpoint, and wire the employee service to return all employees.
Fetch all employee records from the database by autowiring the repository, convert entities to employee data with BeanUtils, and verify the results via Postman.
Create a rest endpoint to fetch an employee by MP code via a get mapping, using a path variable, and convert the entity to a DTO for Postman testing.
Create a rest endpoint with a post mapping to add an employee using an employee dto, convert dto to entity, copy properties, and generate an employee code before saving.
Explore a simple department microservice with REST endpoints for all departments and by id, backed by JPA, MySQL, and Lombok, including DTO converters for department data.
Add the WebFlux dependency in a Spring Cloud microservices project to enable reactive web capabilities.
Learn to call a department microservice from the employee microservice using WebClient, configure the base URL, map the response to a department code field, and update the employee DTO accordingly.
Compare web client and feign client for rest calls in Spring Cloud microservices, and learn to implement a feign client using get mapping annotations for reusable get and post requests.
Add the Openfeint dependency to the microservice by searching for it, selecting Openfeint, and finishing the setup. We will use Openfeint in our employee microservice in the next video.
Implement a feign client in employee service by creating an interface annotated with @FeignClient, configuring the base url from application properties, mapping get /api/departments/{id}, and using it in service.
Debugging the employee and department microservices by fixing the base URL in application properties, using Postman to hit the employees endpoint, and retrieving the department code from the department microservice.
Understand service registry and discovery in microservices, linking department, employee, and account services through a registry server. Use Eureka to register and discover available hostings for scalable routing.
Create a Eureka server by scaffolding a Spring starter project, enabling the Eureka server, and setting properties for port 8761 with no self-registration or registry fetch. Verify at localhost:8761.
Register employee and department microservices with the Eureka server by adding the Eureka client, enabling discovery, configuring the server URL in application properties, and verifying registration.
Learn how to host the department microservice on multiple ports by duplicating configuration and overriding server.port to 8082, creating two instances registered on Eureka at ports 8081 and 8082.
Learn how client-side load balancing distributes employee requests across department service hosts (8081, 8082) using Spring Cloud Load Balancer and Eureka registry; Netflix Ribbon is deprecated.
Add the Spring Cloud Load Balancer dependency for the microservice by selecting Cloud Load Balancer in the starters, then finish with pom.xml.
Configure client-side load balancing from the employee service to the department service using a load balancer client and Feign builder with Eureka service discovery.
Discover the gateway server and why it is needed for central authentication and request forwarding to microservices, using Spring Cloud API Gateway and Eureka to log unauthenticated requests.
Create an api gateway server by starting a Spring project, renaming the microservice to api gateway under com.abcl.gateway, and adding Spring Cloud Gateway and Eureka discovery client dependencies to pom.xml.
Configure the api gateway by setting server.port to 9090 and enabling spring cloud gateway discovery locator; verify registration with the eureka server and test routing through the gateway.
Implement a custom global filter in the API gateway to log requests (uri and authorization header) and responses (status code) using mono, verified with Postman and Eureka.
Update Feign client to call the api gateway service and leverage gateway load balancing, comparing client-side and server-side patterns, with verification via services, Postman, and logs.
Learn how gateway server load balancing distributes requests between department microservices, contrasting client-side and server-side methods, and validate changes by starting services and testing with Postman.
Route requests through a gateway and apply the circuit breaker pattern with resilience4j and retry to pause calls to failing microservices, cycling through open, half-open, and closed states.
Add resilience for AOP and actuator dependencies to the employee microservice, update its pom.xml, and configure resilience in the service.
Configure resilience4j circuit breakers for the employee microservice using application properties, defining failure thresholds, open state duration, and half-open transitions, while enabling health endpoints and indicators for monitoring.
Configure a circuit breaker in the employee service when calling the department service, including a named fallback method, moving the call to a dedicated department service, and Feign client wiring.
Learn how resilience4j governs circuit breakers in a spring cloud microservices setup with an api gateway, Eureka, and employee and department services, demonstrating open, half-open, and closed states.
Learn how Spring Sleuth adds trace IDs and span IDs to requests across gateway, employee, and department services, enabling end-to-end debugging.
Download and set up Zipkin on your local machine using git bash and curl, then start the server with java -jar at localhost:9411; next, configure distributed tracing across microservices.
Add distributed tracing dependencies to the employee and department microservices by updating their pom.xml files with observation bridge brave reporter brave and micrometer, and include the spring actuator for tracing.
Configure distributed tracing for microservices by setting zipkin base URL to localhost:9411, enable 100% sampling, and apply the observed annotation on controllers to trace requests across employee and department services.
Verify distributed tracing across microservices by running services, observing Zipkin traces, and confirming matching trace IDs and span IDs for employee and department calls.
Use spring profiles to tailor environment-specific configurations, and rely on spring cloud config server with a git repository to reload properties at runtime across microservices.
Create a git repository for the spring config server, initialize it, and commit the employee surveys properties after copying and renaming the application properties to the employee service.
Create a config server microservice with config server and discovery dependencies, configure git-backed properties, enable discovery and config server, and test loading default and prod profiles.
Add cloud config dependencies, rename properties to bootstrap.properties, and enable config discovery so the employee microservice reads properties from the config server via Eureka and postman.
Demonstrates how to reload configuration properties from a config server without restarting services, enabling updated UI messages during microservice releases.
Create a server message controller in the employee microservice that returns a config message refreshed on the fly using refresh scope via the Spring Actuator refresh endpoint.
Start the employer microservice and register the config server with Eureka, then refresh configuration on the fly with the spring actuator refresh endpoint to update the server message without restarting.
This course will take you to the learning journey starting from creating the microservice till configuring it with the industry standard cloud technologies. This course is suitable for experienced Java developers as well as those who have little knowledge of Spring framework.
We will first start with creating a simple microservice then we will add entities and dto to the service. Exposing them with controller we will implement repositories and services. After that we will add validations and exception handling to the microservice. Also there will be an assignment for the same with another microservice.
First part can be skipped if anyone want to focus on cloud technologies. Then we will add spring cloud technologies to the course.
Starting with Webclient API we will call one microservice from another. Then by introducing the service registry and discovery we no longer need to maintain the URLs. We will take a look at Open Feign. Adding multiple hosting to microservice needs load balancing the requests between them there we will introduce load balancer. As we will be having multiple hosting there needs a single URL to the user which can be achieved by Spring Cloud Gateway. After introducing the gateway we need resiliency in our services hence introduction to Resilience4J is must. As there will be many calls passing through multiple microservices we will introduce distributed tracing using Spring Sleuth and Zipkin. In the end we will implement Spring Config Server to distribute the configurations across the microservices.