Skip to content
UdemyJava Spring FrameworkPaid courseAll LevelsCertificate

Java Microservices: CQRS & Event Sourcing with Kafka (Udemy.com)

Learn how to create microservices that are based on CQRS & Event Sourcing. Powered by Spring Boot and Apache Kafka.

Created by: Sean Campbell

Last updated September 2025

icon
What you will learn

  • CQRS
  • Event Sourcing
  • Creating DDD-Oriented Microservices
  • Using MongoDB as an Event Store
  • Optimistic Concurrency Control
  • Event Versioning
  • Using Apache Kafka as a Message Bus
  • Implementing the Database-Per-Service Pattern
  • Spring Framework
  • Docker
  • Using MySQL to Implement the Read Database
  • Replay the Event Store and Recreate the State of the Aggregate
  • Replay the Event Store and Recreate the Entire Read Database
  • Replay the Event Store and Recreate the Read Database in a Different Database Type - PostgreSQL

How it compares

Against the other 101 rated Udemy courses in Java Spring Framework on CourseDuck:

  • Rating4.2 out of 5higher than 13% of them
  • Reviews1,241#57 of 102 by number of reviews
  • Length4.8 hoursshorter than 82% of them
  • Last updatedSeptember 2025earlier than 55% of them

icon
Course Description

In this course you will learn how to create Spring Boot microservices that comply to the CQRS and Event Sourcing patterns.

You will not use any CQRS framework, but you will write every line of code that is required to effectively create your own CQRS and Event Sourcing framework using Java and Apache Kafka. While this might sound a little daunting, you will be carefully guided step by step, and gain all the know-how and confidence to become an expert in CQRS and Event Sourcing.

By the end of this course you will know how to:

  • Handle commands and raise events.

  • Use the mediator pattern to implement command and query dispatchers.

  • Create and change the state of an aggregate with event messages.

  • Implement an event store / write database in MongoDB.

  • Create a read database in MySQL.

  • Apply event versioning.

  • Implement optimistic concurrency control.

  • Produce events to Apache Kafka.

  • Consume events from Apache Kafka to populate and alter the read database.

  • Replay the event store and recreate the state of the aggregate.

  • Separate read and write concerns.

  • Structure your code using Domain-Driven-Design best practices.

  • Replay the event store to recreate the entire read database.

  • Replay the event store to recreate the entire read database into a different database type - PostgreSQL.

The ultimate goal of this course is to take a deep-dive into the world of CQRS and Event Sourcing to enable you to create microservices that are super decoupled and extremely scalable.

icon
Udemy Discount

The discount is applied through our link. Open the course from here and Udemy's current promotional price is applied at checkout on most courses, no code to type.

Some courses are excluded from Udemy's promotions. If the price does not drop, clear your browser cookies and use the button again.

icon
Instructor Details

Sean Campbell

Sean Campbell is a highly experienced Software Engineer, specializing in software development for over 20 years. He holds a Master of Science in Software Engineering degree and is particularly interested in software architecture, design patterns, engineering best practices (like SOLID principles), technical documentation, and AI. Sean has held Senior Software Engineer, Technical Lead, and Principal Engineer roles in various industries, including security, mining, insurance, health care, and affiliate marketing. He is an enthusiastic advocate of knowledge sharing and empowering others to become exceptional Software Engineers. Sean has a unique talent for simplifying complex topics to make them practical and easy to understand for anyone.

icon
More courses by Sean Campbell

$11.99

$79.99

icon
More Java Spring Framework courses

$84.99

$84.99

$12.99

$11.99

$10.99

$94.99

icon
Reviews

4.2

1,241 ratings on Udemy

Select a bar to show only those reviews.Select the bar again to show every rating.

By James Chauke on 3/11/2026

Yes, the course is a good match, however it only demonstrate examples using reflection with apply method, one may restrict themselves to one approach. It would be of great pleasure to dive deep and explain to us the reason for selecting reflection as one of the existing approaches amongs other, maybe the advantage of using reflection and the downside of it.

By Alexej Strelzow on 12/30/2024

The course is very straight forward. I used a newer version of Spring Boot and Kafka and had to adjust a few things here and there. But all in all super easy to follow and it worked great. Had some issues with Lombok and IDEA, but could also resolve that. Thank you for the course, it was very helpful and well taught!

By Joseph Sterling Grah on 9/25/2024

Great course with excellent instructor who is right to the point! It was a delightful experience to code along with the instructor and learn by doing! I have setup the project with the latest Spring Boot version 3.3 with Java 21, apart from the database-platform: org.hibernate.dialect.PostgreSQLDialect in the application.yml everything in the code is still valid and works just fine! Thank you sir!

By Helen Ma on 7/6/2024

I like this course because it is a bite-sized course focusing on the key concepts of CQRS. I can easily absorb the CQRS architectural design. It covers a decent amount of contents in Kafka, MongoDB, MySQL and optimistic locking. That is fine with me because Kafka, optimistic locking and etc are not the major topics of this course.

By Taka T on 8/11/2023

CQRSの概要をハンズオンで学べるコースでした。 具体的に動作する実用的なサンプルがあるので、実際の現場に適用するイメージを持ちながら学ぶことが出来ました。 Q&Aにも挙がっていますが、Kafkaを含めたスケールで解決できるのは理屈上は理解できますが、イベント全体をリプレイすることには性能的にやや懐疑的なのと、mongodb側のデータ破損への言及がなかったことはやや不安でした。恐らく普通にバックアップで対応するものと思いますが。 現場への適用にはもう少し落とし込みが必要だと思いますが、CQRSを理解する第一歩としては素晴らしいコースだったと思います。

By Jon on 8/10/2023

The class coding project was well-structured and straight-forward. I ran into a handful of things that didn't work as implemented in the lecture. I was implementing the code as I watched the lectures and ran into a handful of classes that just didn't work; it took some trial-and-error to figure out how to keep his clean interfaces and satisfy the compiler (I'm using Java 17 and the downloaded project uses Java 16).

By Vicent FERRANDIZ on 6/22/2023

The course itself is quite good, but I can not overlook that following the course to the letter, there is a problem in the order of consuming events in different queues, there is a message from the teacher 10 months ago (at the time I write this message) commenting that he will change that part of the course because it is indeed wrong, but still has not done so. It is very serious that a CQRS course where one of the main points should be to ensure that the final state of the aggregate is consistent is not fulfilled, it does not seem to me a good course.

By Anonymized User on 5/22/2023

Instructor just reads his script. Interaction with students with the video is just not there. He will code from class to class and explain the parts; however, the workflow is discussed just after all classes are implemented. He could have made the course shorter if he explained this course like what he did in module #70. Also, this is not beginner friendly as there are topics not known as a beginner.

By Ivo Woltring on 6/8/2022

I found the course of a very good level and speed. Loved the no-nonsense coding. - The trouble is that there has been no attention to testing at all which is a big no-no. - the other thing is that because there is no testing the code was actually wrong. Replay did not guarantee the correct order because of the multiple topics and listeners used. It does not guarantee the correct ordering of the ingestion. Testing that would have helped a lot. it would have been a 5 star rating if these things had gotten any attention

By Lucas Jeremías Couchot on 3/9/2022

Really good introduction to the concepts of CQRS and Event Sourcing in a practical way. One thing I feel is missing is more content regarding a full scale production system (what happens with the event store as it grows over time, caveats of replaying the entire read db when you have other systems that react to replayed events, etc) -> Keep in mind though that this issues are discussed in the questions and Sean gives really clear answers!

Showing all 10 reviews on CourseDuck

Read all 1,241 reviews on Udemy

icon
Quality Score

No CourseDuck member has rated this course yet. Taken it? Give each part a thumbs up or down.

Content Quality
/
Video Quality
/
Qualified Instructor
/
Course Pace
/
Course Depth & Coverage
/

Overall Score : 84 / 100