Kafka & Microservices
Producers, consumers, reliability, transactions & production deployment
Practice interview questions on this topic →Kafka Fundamentals
beginnerBefore you write a line of Spring Boot code, you need the vocabulary and mental model Kafka is built on. Get this module wrong and every later module will feel like memorized incantations instead of engineering decisions.
Running Kafka Locally
beginnerYou can't build intuition for replication and leader election by reading about them. This module gets a real multi-broker cluster running on your machine, and then breaks it on purpose.
Producer & Consumer Internals
beginnerPro"Call send() " and "annotate a method @KafkaListener " are one-liners. What actually happens between those calls and the broker is where most production Kafka bugs live. This module is the internals layer every later module leans on.
The Library Inventory System
beginnerProEvery module from here on either builds a piece of this system or hardens a piece you already built. Get the shape of it into your head now, and every later "why are we doing this" question answers itself.
AI-Assisted / Agentic Engineering
beginnerProThe rest of this site teaches Kafka. This module teaches the workflow used to actually build the reference application with an AI coding assistant — treated as a real engineering practice, not a footnote.
Building the Producer Microservice
beginnerProThe first real code on this site. By the end of this module, HTTP requests into your Spring Boot app are landing as durable records in Kafka.
Testing the Producer
beginnerProA Kafka producer with no tests is a producer you can't safely refactor. This module covers the three layers of testing used throughout the reference app.
API Documentation with OpenAPI / Swagger
beginnerProA Kafka-backed REST API is still a REST API — clients need to discover and try it without reading your source code.
Building the Consumer Microservice
intermediateProThe producer's events are only useful once something reads them. This module wires up @KafkaListener and works through the offset-management decisions that actually matter in production.
Persistence Layer
intermediateProThis is where consumed events stop being ephemeral. Postgres, Flyway, and the NEW-vs-UPDATE logic that makes the consumer more than a dumb logger.
Testing the Consumer with Embedded Kafka
intermediateProThe producer's Embedded Kafka test (Module 07) proved a record lands in Kafka. This module proves the consumer turns that record into correct database state — the assertion that actually matters end to end.
CRUD & Exposing Data
intermediateProKafka got the data into Postgres. Now the consumer needs its own REST surface so the data is actually usable by clients — closing the loop on the architecture from Module 04.
Producer Reliability & Errors
intermediateProEvery setting in this module trades something for something. Understanding the trade, not just the property name, is what separates a config you copy-pasted from one you can defend in a design review.
Consumer Errors, Retry & Recovery
intermediateProA producer failure is your problem alone. A consumer failure can block an entire partition behind one bad record forever, if you don't design for it. This is the most consequential module on the site for production stability.
Consumer Timing Configurations
intermediateProMost "mystery rebalance storms" in production trace back to one of the three settings on this page being wrong relative to how long your listener actually takes to run.
Transactions & Exactly-Once Semantics
advancedPro"Exactly once" is the most misunderstood phrase in Kafka. This module defines it precisely, then builds it.
Health, Monitoring & Observability
advancedProA service that's running isn't the same as a service that's actually able to do its job. This module builds the health signal that Module 20's Kubernetes probes will later consume.
Packaging & Running Standalone
advancedProA short but necessary bridge module: before either service can be containerized (Module 19), it needs to run correctly outside the IDE.
Containerization with Docker
advancedProThe JAR from Module 18 now becomes a portable, versioned artifact that runs identically anywhere Docker does — the prerequisite for Module 20's Kubernetes deployment.
Kubernetes Deployment
advancedProDocker runs one container. Production needs many, self-healing, scaled, configured per environment, and routable from outside the cluster — that's the job Kubernetes does.
Kafka Security (SSL/TLS)
advancedProEverything so far ran on a plaintext local cluster. This module is the one thing standing between this reference architecture and something you'd actually be allowed to run against a real production broker.
Capstone & Synthesis
advancedProEvery module built or hardened one piece. Here's the whole system, fully assembled — and where to go if you want to push past what this site covers.