
Main objectives and benefits of the course
The architectural big picture of the project and introduction to event-driven architecture and event-driven services
The implementation details of all microservices and components that the course covers
Set up the development environment by installing Java 25, Maven, IntelliJ, Git, and Docker, verify installations with version commands, and configure path and Javahome for permanence.
You can find the code repository until section 5 with latest update here in this Github Repository https://github.com/agelenler/microservices-demo
Discover generative AI with Spring AI to create tweet content without Twitter API, and learn model selection, prompt engineering, and using OpenAI, Vertex AI, or local llms like Llama.
Explore generative AI and large language models (LLMs) and their role in content creation, from text and images to code, with steps like pre-training, fine-tuning, and RAC.
Learn how to choose the right LM model for a task by weighing requirements, budget, and accessibility, and compare open source versus commercial options for privacy and cost.
Explore prompt engineering techniques to optimize interactions with large language models, including zero-shot, few-shot, chain-of-thought, system messages, prompt templates, temperature and top-p controls, with iterative refinement and context-aware prompts.
Enable seamless ai integration in Spring Boot apps with Spring AI, offering auto configuration, prompt templates, and real-time streaming responses from OpenAI and local llms.
Discover how Spring Boot enables lightweight standalone apps with auto configurations and starter modules. Explore web, test, actuator, security, data JPA, Thymeleaf, and cloud starters such as OAuth2 resource server.
Create a base project using start.spring.io. Adjust the pom.xml file to prepare it as a base file for sub-modules. Explain the basics of maven dependencies and plugins.
The first microservice as a maven module. Create a spring boot application. Create a basic test class. Implement initialization logic using CommandLineRunner and explain other options. Add configuration variables using application.yml. Add logging using slf4j and a logback.xml file. Describe constructor injection, and understand advantages over field injection.
Configure logback with console and file appenders, pattern, and rolling policy to print AI-generated keywords from config for the AI tweet to Kafka service, while comparing injection methods.
Obtain and configure OpenAI, Google Vertex AI, and DeepSeek API keys, set environment variables, and integrate them into a Spring Boot app to generate TV content.
Develop a skeleton microservice that implements the command component of a CQRS and event-sourced architecture, streaming AI-generated tweets to Kafka using Spring Boot and multiple AI providers.
Learn to generate tweet-like data via direct HTTP calls to the OpenAI API in a Spring Boot microservice, configuring dependencies, prompts, and OpenAI request/response models for Kafka publishing.
Generate tweet content by building a keyword-driven prompt from configuration and sending it to the OpenAI API via direct HTTP requests in a Spring Boot microservices setup.
Learn to implement an AI service with the OpenAI Java library, switch between OpenAI service and OpenAI Java client via config, and generate tweets using chat completions.
Enable tweet generation with Google Vertex AI by integrating the Google AI dependency, configuring project, location, model, max tokens, and temperature, and implementing a Vertex AI backed AI service.
Generate tweet content using Spring AI and OpenAI within a Spring Boot microservices setup, configuring dependencies, the OpenAI client, and prompt templates to produce structured tweets.
Illustrates switching from OpenAI to the DeepSea API via Spring AI, updating the API key and base URL, and using the Leipzig chat model to generate tweet data.
Generate tweet data locally using spring ai with Olama and the Leipzig R110b model, connected to a local Olama instance for Kafka.
Introduction to spring boot, starter modules and pre-configured dependencies.
Create a base project using start.spring.io. Adjust the pom.xml file to prepare it as a base file for sub-modules. Explain the basics of maven dependencies and plugins.
The first microservice as a maven module. Create a spring boot application. Create a basic test class. Implement initialization logic using CommandLineRunner and explain other options. Add configuration variables using application.yml. Add logging using slf4j and a logback.xml file. Describe constructor injection, and understand advantages over field injection.
Stream tweets from Twitter to Kafka using a mock Twitter stream, with a Spring Boot Twitter Kafka stream runner as the command component in a CQRS and event-sourcing setup.
Learn to stream tweets using the Twitter v2 API in a Spring Boot microservice, configuring v2 endpoints, bearer tokens, and streaming rules, with a mock alternative for free streaming.
Learn to implement a mock Twitter stream with MockKafkaStreamRunner, switchable via Spring Boot conditions, and configure mock tweets to run on a dedicated thread using a configurable delay.
Explore Apache Kafka as an immutable event store for an event-driven microservices architecture, covering topics, partitions, producers and consumers, replication, throughput, and key producer configurations.
Create a reusable app-config-data module to hold configuration data classes, enable externalized configuration across microservices with Spring Boot, and adjust component scanning and dependencies for seamless integration.
Set up a local Kafka cluster with Docker Compose, including Zookeeper, Schema Registry, and three brokers for quorum; monitor with kafkacat and scaffold submodules kafka-model, kafka-admin, and kafka-producer.
Build a kafka-model java object for kafka communication using Avro schema types. Configure Avro dependency and avro-maven-plugin in pom.xml, define Avro schema, and generate the model via mvn clean install.
Develop a kafka admin module with the admin client to create and verify topics, and implement retry logic with Spring Retry and Spring AOP for startup readiness.
Develop and validate a Kafka admin module that creates topics programmatically, with retry logic, topic status checks, and schema registry health checks, while integrating a web client for REST calls.
Implement a spring kafka producer module using confluent kafka avro serializer, add dependencies and exclusions, and configure producer properties in application.yml with key/value serializers and acks all.
Learn to implement a Kafka producer module by configuring a Kafka template and producer factory, wiring serializers and Avro schema, and handling asynchronous send callbacks for reliable event production.
Integrate the Twitter microservice with Kafka by using admin and producer modules to create topics, verify schema registry, and transform Twitter status to Avro for sending to Kafka.
Create a docker image for the twitter-to-kafka microservice using Spring Boot build-image, then run the dockerized Kafka cluster and services with compose and validate with kafkacat.
Implement externalized configuration for microservices with spring cloud config server by creating a config server repository and initializing a git repo. Define config client yaml and twitter to kafka yaml.
Create a spring cloud config server microservice by adding the config server module and setting server port 8888. Configure dependencies, bootstrap, and a git repository to enable config retrieval.
Centralize logging by using a common logback xml in the app config data module and including it in each service’s logback to share appenders, with dev home and name configurable.
Enable twitter-to-kafka to fetch remote config from spring cloud config server via bootstrap yaml and config-client, ensuring the config server and kafka cluster run before mvn install.
Learn how to configure a remote github repository for a Spring config server, switch to main branch, use personal access tokens, and run twitter_to_kafka with config server and kafka.
Add basic authentication to the config server by configuring spring security and updating bootstrap yaml with spring_cloud_user and spring_cloud_password for both services; encrypt passwords using jasypt and jce branches.
Implement jasypt in a Spring Boot app with the jasypt spring boot starter, encrypting secrets and managing the encrypter password via environment variables for runtime decryption.
Encrypt secrets with Java cryptography extension using the spring encrypt command, updating bootstrap yaml. Use config server endpoints to decrypt and set encrypt_key as an environment variable.
Compare Jasypt and JCE for encrypting secrets, highlighting PBKDF2, salt, and iteration count, and discuss symmetric vs asymmetric approaches, config server decryption, and SSL/TLS in production.
Build a config server docker image with the spring boot maven plugin, configure docker compose, enable health checks for the actuator endpoint, and run twitter-to-kafka and config server together.
Explore how a Kafka consumer reads events from topics and partitions, manages offsets, and joins consumer groups for scalable processing. Understand delivery semantics and Spring Kafka support for reliable consumption.
Learn to add a Kafka consumer module, configure Avro deserialization, and set consumer properties like group id, auto offset reset, batch listener, and concurrency in a Spring Boot microservice.
Build the Kafka to Elastic service with Spring Boot, Spring Kafka, and Avro, configure the config server, and implement a Twitter Kafka consumer to log messages.
Create an onAppStarted event handler annotated as an EventListener to verify Kafka topics are created for elastic. Start the listener container explicitly after checks and disable auto startup.
Explore Elasticsearch basics and how the open source search engine uses Apache Lucene, RESTful JSON APIs, dynamic mapping, inverted indexes, analyzers, and a powerful query DSL.
Set up a three-node elasticsearch cluster with docker compose, enabling quorum via master eligible nodes, discovery seeds, memory lock, and expose port 9200; update env file to set version.
Create the elastic-model module with spring boot data elasticsearch and lombok, implementing TwitterIndexModel as a twitter-index document driven by elastic-config data.
Add the elastic config module and dependencies version 7.9.1. Implement ElasticSearchConfig to expose a high level rest client bean using UriComponentsBuilder for host, port, schema, with timeouts.
Create an elastic index client to perform bulk indexing against Elasticsearch, wiring app config and elastic model dependencies, and implement an elastic index util for converting documents to index queries.
Learn to index with Elasticsearch repositories in Spring by configuring a conditional on property to switch between Twitter Elasticsearch index client implementations and compare repository-based approaches with low-level Elasticsearch queries.
Integrate elastic modules with the Kafka to Elastic service by adding dependencies, transforming Avro models to Elastic models, and persisting tweets to Elasticsearch using a transformer and Elastic index client.
Build and run the kafka to elastic service in docker compose, using spring boot maven plugin to create the image, configure depends_on, and validate topics with startup scripts.
Explore querying Elasticsearch with its DSL using Postman. Index data and practice key queries like match, term, keyword, query_string, and wildcard, plus size and scroll controls.
Develop an elastic query client module for the elastic query microservice to query Elasticsearch by ID, text, or all, using native and bool queries.
Leverage a spring data elasticsearch repository to query the twitter index by text and id, using a dedicated query client and a singleton collections util.
Builds the elastic query microservice as the CQRS query component, querying Elasticsearch and separating command and query paths in an event-sourced, Kafka-based microservices architecture.
Create a Spring Boot web controller under /documents with lombok-based request and response models, and secure endpoints using HTTP basic auth and bcrypt password encoding.
Create a Spring service layer to return elastic data in the controller by implementing ElasticQueryService, converting Twitter index models to response models with ElasticToResponseModelTransformer, and wiring through TwitterElasticQueryService and ElasticQueryClient.
Add spring boot validation and use NotEmpty and Valid to validate inputs, then implement a controller advice to handle AccessDeniedException, IllegalArgumentException, RuntimeException, and method argument validation errors.
Explore HATEOAS, hypermedia as the engine of application state, and see how REST responses use hypermedia links and HTTP verbs like GET, POST, PUT, DELETE, and PATCH.
Add hateoas support to the rest api with spring boot hateoas starter, and build an assembler to expose hypermedia links via toModel and toModels.
Learn API versioning for REST services, including semantic versioning, backward and forward compatibility, and when to introduce major versions. Compare URI, media type, headers, and query parameter versioning.
Implement api versioning for the Elastic query service using uri and media type approaches, adding v2 models, mappings, and hateoas links.
Apply open api v3 documentation to a spring boot elastic query service using springdoc-openapi-ui. Generate json, yaml, and html docs with swagger annotations and content negotiation.
Create the elastic query service docker image with the spring boot maven plugin, set environment variables (including port 8183), and run via docker-compose to test the API with postman.
Build a non blocking web client with Spring web client to access elastic query service, using Thymeleaf and Bootstrap for the frontend, and a client-side load balancer by Spring Boot.
Begin implementing the elastic-query-web-client module by adding dependencies, configuring a web client with timeouts and base URL, and setting up thymeleaf, security, and config server, plus a context load test.
Create Thymeleaf templates with bootstrap, place header, footer, and error pages in resources/templates, and build a home page with a search form using th:action, th:object, th:each, and th:switch.
Develop a Spring Boot web controller with validation for query-by-text, define elastic query request and response models, and integrate thymeleaf with error handling via a controller advice.
Adds security to the web client by configuring http basic authentication and in-memory bcrypt users, while laying groundwork for oauth and openid connect, plus a load-balanced web client builder.
Develop an elastic query web client with ElasticQueryWebClient and a Spring service, posting to get-document-by-text and returning response models for Thymeleaf display.
Add spring cloud load balancer and apply LoadBalanced to the web client, configuring elastic-query-service with two instances on ports 8183 and 8185, later replacing with discovery service and api gateway.
Create a docker image for the web client with spring boot maven plugin, run it via docker compose, and observe load balancing across two query service instances that call Elasticsearch.
Create reusable elastic query service and web client modules by building a common module with shared models, transformers, and controller advice, enabling dry reuse across reactive and non-reactive versions.
Learn to build a reactive elastic query service with Spring Boot WebFlux, reactive elastic repository, and Flux-based streaming, including back-pressure and Reactor Netty backend.
Develop a reactive elastic query web client using spring webflux and webclient, leveraging the elastic query web client common module, config server, and thymeleaf reactive templates to stream Flux results.
Hi there! My name is Ali Gelenler. I'm here to help you learn event-driven microservices architecture by applying best practices for real-life challenges.
Important Update: This course was using Twitter api as the source data. Twitter changed the twitter developer account to a paid subscription. After this, with the latest update series, instead of streaming data from Twitter, Generative AI is used to simulate tweet streaming using Spring AI with various LLMs, so that you can create the tweet content using a Large Language Model. For this I added examples from different providers using different models as listed below.
Generate Tweet data using Open AI API using direct Http request
Generate Tweet data using Open AI Java SDK
Generate Tweet data using Google Vertex AI
Generate Tweet data using Spring AI and Open AI
Generate Tweet data using Spring AI and DeepSeek
Generate Tweet data using Spring AI, Ollama and DeepSeek locally
You can see the new implementations with [NEW] prefix in the lectures. I kept the old twitter implementation for now using [OLD] prefix so that you can compare the old and new implementations. The old lectures will be deleted in time.
In this course, you will focus on the development of microservices. With the help of microservices you can independently develop and deploy your application components . You can also easily scale services according to each service's own resource needs, for example you can scale better and create more instances of a service that requires more requests.
You can always use the latest versions for spring boot, spring cloud and other dependencies in this course. Please just follow the last section's lectures to see the required code and configuration changes for updated versions. Also if you would like to use subtitles during the course, you can turn on the captions on videos as all lectures are updated with hand-written subtitles. I suggest using subtitles to make it easier to follow the lectures.
When moving from a monolith application to microservices architecture, some challenges will arise as a result of having a distributed application and system. In this course you will learn how to deal with these challenges using event-driven architecture (EDA) architecture with Apache Kafka.
With an event-driven architecture;
You will truly decouple the services and create resilient services because a service has no direct communication with other services
You will use asynchronous/non-blocking communication between services
You will use an event/state store (Kafka), and remove the state from the services for better scalability
Tanima: "This is one of the best course i ever had in udemy, instructor is super responsive and always deals with complex problem during the course, Thank you so much Professor i will always be grateful to you for this course, and will keep eye on your next course release."
You will develop a microservice architecture from scratch using the most recent software platforms, technologies, libraries and tools, following best practices, applying microservices patterns and using Java, Spring boot, Spring cloud, Spring Security, Kafka and Elasticsearch. We will also cover Event sourcing and Event-driven services using Kafka as the event store.
The microservices patterns that you will be implementing are:
Externalized configuration with Spring Cloud Config
CQRS with Kafka and Elastic search
Api versioning for versioning of Rest APIs
Service Registration and Discovery with Spring Cloud and Netflix Eureka
Api Gateway with Spring Cloud Gateway
Circuit breaker with Spring Cloud Gateway and Resilience4j
Rate limiting with Spring Cloud Gateway and Redis to use Redis as the Rate limiter
Distributed tracing with SLF4J MDC, Spring Cloud Sleuth and Zipkin
Log aggregation with ELK stack (Elasticsearch, Logstash and Kibana)
Client side load balancing with Spring Cloud Load Balancer
Database per Service
Messaging between microservices using Kafka
You will also implement Spring Security Oauth 2.0 and OpenID connect protocols for Authentication and Authorization using Keycloak and JWT. The use of Oauth for authorization of services and OpenID connect for authentication is widely used in microservices archictecture with Spring boot security.
Oliver Michels: "Amazing course that covers a lot of ground, i.e. Spring Boot, Kafka, Elastic, OAuth/Keycloak, etc. and shows how all those pieces fit together in a nice microservice architecture."
Another important topic that you will focus on is the monitoring of microservices. You will use Spring boot actuator and Prometheus with Micrometer which can be used to get metrics such as health, number of running threads, number of requests, response time and memory usage. You will also learn to use Grafana to create a nice dashboard to visualize the metrics that you obtained using Spring boot actuator and Prometheus.
While introducing event-driven microservices, you will understand the basics of Apache Kafka by covering Kafka topics, Kafka partitions, Kafka consumer and producer APIs, Kafka admin client and Avro messaging.
Emre Demir: "This is not only a software tutorial. It is an advanced computer engineering course. The examples and descriptions are excellent. Full-stack and Back-end developers must take."
To communicate between microservices, apart from using Kafka messaging, I will also introduce Kafka Streams and show how to use Kafka Streams to create a temporary state store with the accumulated streaming data. This temporary data source will then be consumed by another microservice.
To communicate with the data stores in microservices I will use different Spring Data dependencies, such as Spring Data JPA with PostgreSQL, Spring Data Elasticsearch and Spring Kafka.
For the Api documentation, I will use Open Api 3 specification which implements Swagger 3.0. Open Api will create a RESTful interface for an API and help you to easily develop and consume a Rest API.
You will also learn how to use Hateoas (Hypermedia as the Engine of Application State) in a Rest Api with Spring Hateoas. Hateoas will provide links to resources on the server, and update the REST API response with these links to interact with the client dynamically. This will enable developing level 3 Rest APIs.
Sidhartha Mallik: "This course is to the point - and great one for every level, strongly recommend"
There is also a reactive development section in this course which demonstrates querying elasticsearch reactively with Reactive Spring, WebFlux, WebClient and Reactive Thymeleaf. In this section you will learn how to use Spring Webflux and Spring reactive components to create an asynchronous flow between microservices.
You will use Spring boot and Spring cloud along with Docker for developing cloud ready microservices. Docker is a containerization platform and it enables to package applications into containers. These containers can later run in any environment that docker is running. In this course you will create the docker images of the microservices that you have developed. Then use docker compose to run all the containers of microservices together, along with the other dependencies such as Kafka, Elasticsearch, Keycloak, Redis, Prometheus, Grafana and Zipkin . In the end a single 'docker-compose up' command will be enough to run all microservices architecture together with the required dependencies. Having these docker images will enable you to deploy your application to any cloud vendor easily.
Mohammed O. Tillawy: "amazing course, but prepare yourself, very intense, and tons of info, needs focus and patience."
You will be following a hands-on approach and be developing a project from scratch in which you will have multiple microservices surrounded with multiple modules to accomplish the specific tasks. So you will need to make your hands dirty in this course where I will be guiding you from start to finish. You will also find multiple choice quizes in each section to check your progress throughout the course.
At the end of the course you will not only understand the real life challenges of a distributed application with multiple services and components, but also you will be able to apply solutions to this challenges.
You can download the source code in each lecture separately and run them easily using your IDE or docker.
Ido Charar: "This course by Ali Gelenler is outstanding. It is not just about Spring Cloud with kafka and elastic. This course gives you much more knowledge around technologies related to Spring Cloud in particular and Cloud Computing in general. Among them are technologies like reactive programming, streaming, linux OS, security, Design Patterns and much much more. All the information is given in succinct but ingestable form, which allows you broaden your skills in shortest possible time. Very appreciate the investment in material, lecturer involvement, constant assistance and help to the students. Will recommend to take this course everyone who want to level up her/his skills."
For more detailed information on the progress of this course, you can check the introductory video and free lessons, and if you decide to enroll in this course, you are always welcome to ask and discuss the concepts and implementation details on Q/A and messages sections. I will guide you from start to finish to help you successfully complete the course and gain as much knowledge and experience as possible from this course.
Shantanu Srivastava: "I brought this course specifically for learning Apache Kafka and after going through the Introduction video, I find out that this course will cover literally every single thing you need to know as a spring developer. From API gateways and Service Discovery, to log forwarding and resilience and so much more. Awesome!!"
Remember! There is a 30-day full money-back guarantee for this course! So you can safely press the 'Buy this course' button with zero risk and join this learning journey with me.