
Explore a full microservices architecture with Java and Springboard, including service discovery, centralized config with refresh, message brokers like Kafka, and patterns such as API gateway and circuit breaker.
Generate and set up the product service for a spring boot microservices project, import into IntelliJ, configure Java 11, and verify dependencies for a successful build.
Configure the product service to connect to a local MongoDB by setting application properties, then create a product entity annotated as a document with name, image, and price fields.
Create a product repository as a full interface and extend it for more entities. Use a minimal entity to perform database operations with the Modiba database and a primary key.
Create a product controller in a Spring Boot microservice, exposing GET and POST endpoints via request mappings, managing product entities and status responses.
Test GET and POST endpoints with Postman on localhost 1818, and verify the database connection while examining products stored as documents in a collection and linked to tables.
Generate and set up a booking service by configuring dependencies, enabling Spring Data JPA interactions with the database, and verifying a successful startup connection to the database.
Explore how a discovery service and a service registry automate instance registration and name-based lookups, enabling apps to locate services without hardcoding endpoints and supporting load balancing across multiple instances.
Set up a discovery service for Spring Boot microservices, configure client registration rules to prevent the discovery server from registering itself, and verify the dashboard locally on port 8761.
Register a product service as a discovery client in a Spring Boot microservices setup, configuring dependencies and properties to enable dynamic ports, multiple instances, and registration with the discovery service.
Register the booking service as a client to the discovery service by copying product service dependencies and updating properties, then launch two instances and verify registration on the discovery dashboard.
Implement centralised configuration via a config server to update properties across microservices on the fly, avoiding rebuilds and redeployments for consistent runtime changes.
Create a new git repository, set up two properties files—one for the booking service and one for product—and define variables to demonstrate properties management.
Generate a GitHub token then use it in IntelliJ to push code, connecting securely, selecting token permissions, and confirming successful pushes and repository updates.
Create a Spring Boot config server to connect to Git and fetch properties for multiple services, add the actuator, and configure dynamic dependencies for a ready microservices setup.
Configure a config server to fetch profile-specific properties from GitHub, switch between default and product profiles, push changes to Git, and have properties refreshed without restarting the application.
Add Spring Cloud Config client and bootstrap dependencies, bootstrap properties, and the dev profile to the booking service, then test connectivity to the config server.
Connect the product service to the config server using a dev profile, copy bootstrap properties, and configure a product profile for on-the-fly updates without restart; demonstrate centralized configuration across microservices.
Enable dynamic configuration refresh across microservices using refresh scope, allowing GitHub config updates to propagate to controllers and beans via actuator refresh endpoints.
Implement refreshing of the configuration by adding the actuator dependency and refresh scope, expose a prop one value through a test controller, and validate live updates via the refresh api.
Move properties to bootstrap.properties and restart the server to enable dynamic refresh from the config server, then see updated prop values without a restart.
Install HashiCorp Vault on your computer to securely store credentials and avoid hardcoding. Download the zip, extract it, and prepare to set environment variables in the next video.
Install the extractor, configure Vault via a system environment variable in Windows, set the correct path, run the documented dev-mode Vault command, and verify it starts from a command prompt.
Store booking service secrets in vault by migrating credentials from a property file to a bootstrap config, creating a json secret, and persisting with vault put.
Connect microservices to vault data by configuring cloud config and bootstrap properties to fetch credentials securely. Start services with a token-based authentication mode to access secrets and enable service discovery.
Implement a bus-based config refresh using a message broker to auto-publish configuration changes to multiple microservices, such as booking and product services, by adding spring cloud starter bus mgp dependency.
Install rabbitmq as a message broker using docker or native installers, then configure Spring Boot with localhost, port 5672, and guest/guest credentials.
Discover how a rabbitmq based message broker enables bus refresh to propagate config server data to all microservices, so a single refresh updates product and booking services.
Learn to fetch credentials from a key vault instead of hardcoded properties, diagnose secret lookup failures, and ensure proper secrets for booking and product services.
Learn how an API gateway fronts multiple microservices, routes traffic via a discovery service with Eureka, handles authentication and authorization with Quick Lock, and monitors and enforces rate limits.
Register the API gateway with the discovery service by adding spring cloud netflix eureka client dependency, configure bootstrap properties, expose /products and /categories, and enable discovery locator and load balancing.
Test the api gateway in a spring boot microservices setup by registering services with Eureka, starting it on port 880, and routing product and booking endpoints through the gateway.
Configure API gateway routing to expose multiple controllers under a single product service using a single routing rule, mapping endpoints like /api/products/* to specific controllers and validating with postman.
Install and configure Keycloak to secure the API gateway used by microservices. Configure identity and access management, authentication, and single sign-on to control access.
Configure a Keycloak client and user for secure spring boot microservices by creating admin credentials, setting up a realm and client, and configuring OpenID Connect redirect and API gateway integration.
Configure the API gateway to connect to Keycloak for authentication and authorization using spring cloud security and oauth2 client. Implement a filter chain that intercepts requests and enforces authenticated access.
Configure the product service as a resource server, connect to Keycloak, and implement jwt-based authentication with a security configuration. Start the product service and api gateway to test the setup.
Discover how the circuit breaker pattern prevents cascading failures in microservices by halting calls to slowing or down services, shown with booking and product interactions using Hystrix and Resilience4j.
Generate a stock management service from a Spring Boot starter and scaffold stock service. Include dependencies like Lombok, Spring Web, Spring Security, a relational database, and cloud bus with Eureka.
Create a stock entity using jpa and a repository extending JpaRepository. Expose a controller endpoint that checks stock by product code, throwing if not found.
Configure stock service resources by updating bootstrap properties, app name, and data source; load key vault secrets, start the service, and verify Eureka registration and initial data.
implements entity models for the booking service, including order and order item, establishes a one-to-many relationship, and wires a repository and controller to save orders via post mapping.
Demonstrates implementing a Feign client to call the stock api from the booking service, enabling Eureka-driven load balancing and checking stock for order items.
Implement the circuit breaker in the booking service to gracefully handle failures from the product stock API, using Hystrix or Resilience4j with a fallback that returns a user-friendly message.
Learn to implement SpringBoot based Microservices and RESTful API's architecture from scratch in a practical step by step approach.
Microservices architecture has many advantages like:
Improved productivity
Better resiliency
Increased scalability
Continuous integration/continuous delivery (CI/CD)
Optimize business functionality
and many more
We will be implementing many important concepts of microservices architecture like
Spring Cloud Config Server
Spring Cloud Bus
Spring Cloud Netflix Eureka
Spring Cloud Circuit Breaker
Spring Cloud Sleuth
Spring Cloud Gateway
Spring Cloud Stream
We will be creating many springboot projects from scratch from spring initializer, some of the microservice will be based on mongodb and some will work with mysql database.
Following are the steps we will cover:
1.1-Generating and Setting up of product service
1.2-Create product entity class with annotation
1.3-Create product repository
1.4-Creating controller and GET and POST endpoints
1.5-Test GET and POST endpoint with Postman
2.1-Generating and Setting up of booking service
2.2-Understanding Discovery service and Service registry
2.3-Generating and Setting up Discovery Service
2.4-Registering Product service as client to Discovery service
2.5-Registering Booking service as client to Discovery service
2.6-Understanding config server and centralized configuration
2.7-Create git repo and add properties files
2.8-Generate github token and use in Intellij to push code
2.9-Generating and Setting up of Configuration service
2.10-Configuring config server to fetch different profile based properties from github
2.11-Connecting booking service to config server on dev profile
2.12-Connecting product service to config server on dev profile
2.13-RefreshScope introduction
2.14-Implementing RefreshScope Part-1
2.15-Implementing RefreshScope Part-2
2.16-HarshiCorp vault setup part-1
2.17-HarshiCorp vault setup part-2
2.18-Storing booking service secrets in Vault
2.19-getting vault data in microservice
3.1-Implementing message broker
3.2-Installing RabbiMQ
3.3.0-Using RabbitMQ in microservice
3.3.1-Fixing the vault secret fetching issue
3.4-What is API Gateway
3.5-Setup and Configuration of API gateway
3.6-Testing the API's with API Gateway Part-1
3.7-Testing the API's with API Gateway Part-2
3.8-Installing and setting up Keycloak server
3.9-Configuring keycloak client and user
3.10-Configuring spring security filter in API Gateway to intercept request
3.11-Configure Product Service as Resource Server
3.12-Testing API Gateway and Keycloak security
4.1-Overview of Circuit Breaker Pattern
4.2-Generating the stock project from springboot starter
4.3-Implementing entity repository and controller
4.4-Configuring properties for stock service
4.5-Implementing entity controller repository for booking service
4.6-Implementing Feign client call from booking to stock service