Event-Driven Microservices: Spring Boot, Kafka and Elastic

Master event-driven microservices architecture with patterns using Spring boot, Spring cloud, Kafka and Elasticsearch

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.

What you’ll learn

  • Master Microservices architecture with Spring boot and Spring cloud stack.
  • Develop Event-driven microservices with Apache Kafka.
  • Understand Containerization of microservices with Docker and Docker compose.
  • Learn Basics of Kafka brokers, topics, partitions, producers, consumers, admin client, avro messaging, zookeper and schema registry.
  • Learn Basics of Elasticsearch, index api and query api.
  • Implement Kafka based messaging applications with Spring Kafka.
  • Understand Elasticsearch indexing and queries with Spring Data Elasticsearch.
  • Implement CQRS pattern with Kafka and Elasticsearch.
  • Implement Externalize configuration pattern with Spring Cloud Config.
  • Develop Rest API.
  • Implement Api versioning for versioning of Rest APIs.
  • Implement Spring Data JPA with PostgreSQL.
  • Understand Service Registration and Discovery with Netflix Eureka and Spring cloud.
  • Implement Client side load balancing with Spring Cloud Load Balancer.
  • Understand Api Gateway pattern with Spring Cloud Gateway.
  • Implement Circuit Breaker pattern with Spring Cloud Gateway and Resilience4j.
  • Implement Rate Limiting with Spring Cloud Gateway and Redis.
  • Understand Authentication and Authorization with Spring Security Oauth 2.0 and OpenID connect protocols with Keycloak using JWT.
  • Implement Monitoring of microservices with Spring Boot Actuator, Micrometer, Prometheus and Grafana.
  • Understand Log aggregation patterns and visualization with ELK stack – Elasticsearch, Logstash and Kibana.
  • Understand using Hateoas in Rest APIs with Spring Hateoas.
  • Implement Open Api v3 for Restful API documentation with Swagger v3.
  • Use Thymeleaf and Bootstrap for a basic front-end.
  • Understand Reactive development and asynchronous flow by querying Elasticsearch reactively with Reactive Spring, WebFlux, WebClient and Reactive Thymeleaf.
  • Learn Distributed tracing with Slf4J MDC, Spring Cloud Sleuth and Zipkin.
  • Understand Database per Service pattern.
  • Understand using Kafka streams with state store.
  • Learn streaming tweets from Twitter using Twitter4J.

Course Content

  • Introduction to microservices architecture –> 3 lectures • 38min.
  • Setting up the environment –> 1 lecture • 4min.
  • First service: twitter-to-kafka-service – How to use Twitter4j & Kafka producers –> 15 lectures • 2hr 27min.
  • Externalizing configuration with Spring Cloud Config Server –> 10 lectures • 47min.
  • kafka-to-elastic-service: How to use Kafka consumers and Elastic Index API –> 12 lectures • 1hr 8min.
  • Elastic query microservice:Rest API, versioning, Hateoas,Open Api, Elastic query –> 13 lectures • 58min.
  • Query web client microservice: Using REST Api, Webclient, Thymeleaf, Bootstrap –> 8 lectures • 29min.
  • Reactive version of elastic query service and web client: Using Reactive Spring –> 3 lectures • 15min.
  • Securing the services: Spring security OAuth2, OpenID connect, Keycloak and JWT –> 7 lectures • 1hr 4min.
  • Kafka streams with a new microservice: How to use Kafka streams state store –> 5 lectures • 29min.
  • Creating Analytics service: How to use Spring Data JPA with PostgreSQL –> 4 lectures • 17min.
  • Implement service discovery with Netflix Eureka and Spring Cloud: Spring Eureka –> 2 lectures • 8min.
  • Spring cloud Api Gateway with Resilience4J Circuit Breaker & Redis Rate Limiter –> 3 lectures • 20min.
  • Monitoring and visualisation with Spring boot actuator, Prometheus and Grafana –> 2 lectures • 7min.
  • Implementing Distributed tracing and Log aggregation with visualisation by ELK –> 3 lectures • 11min.
  • Integrating Spring Sleuth and Zipkin for Distributed tracing & Log aggregation –> 2 lectures • 16min.
  • Version updates:Update to latest Spring boot, Spring cloud & other dependencies –> 3 lectures • 44min.

Auto Draft


  • Knowledge of Java.
  • Basic knowledge of Spring Framework.
  • Back-end development experience.

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.

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.

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.

Get Tutorial