Kafka problems in Spring Boot rarely show up as errors. Events go missing after a successful database commit, consumers process the same message twice, and total lag looks healthy while one partition is stuck. These articles trace real incidents and the fixes we tested.
All articles on this page are also collected in a Medium list you can save and follow.
Start here
- Spring Boot Saved the Order. Kafka Never Received the Event. — the dual-write gap between the database and Kafka, and the transactional outbox fix
- Our Kafka Consumer Generated the Same Report Twice — why at-least-once delivery produces duplicates and how idempotent consumers stop them
- Kafka Lag Looked Fine. One Partition Was Not. — per-partition lag that total lag hides
Delivery and consistency
- Spring Boot Saved the Order. Kafka Never Received the Event. — database commit succeeds, event never arrives
- Our Kafka Consumer Generated the Same Report Twice — duplicate processing after retries
- Postman Timed Out, but Kafka Was Still Receiving Jobs — the client gave up, the broker kept accepting jobs
Consumers, lag and partitions
- Kafka Lag Looked Fine. One Partition Was Not. — one stuck partition behind a healthy total
- Kafka Lag Hid a Database Bottleneck — lag caused by a slow downstream database
- One Kafka Consumer Group ID Stopped Our Reports From Running — consumer group reuse that stopped report processing
- Spring Boot Kafka Failed Without Consumer Discipline — consumer configuration that holds up in production
Schemas and local setup
- Kafka Avro Broke When Schema Evolution Drifted — schema evolution with Avro and a schema registry
- Kafka Server on Docker with WebUI for Monitoring — a local Kafka broker with a web UI for monitoring
RabbitMQ
- Spring Boot RabbitMQ Fails Without Backpressure — backpressure for RabbitMQ consumers
- RabbitMQ on Docker and WebUI for Monitoring — a local RabbitMQ broker with the management UI
Also on bytzecho.com
Versions of these articles on this site, with extended code and notes.
- Spring Boot Saved the Order. Kafka Never Received the Event. — the transactional outbox write-up with code.
- Kafka Wasn’t Broken. We Reused the Same Consumer Group ID — a real example of group ID reuse causing confusing consumer behavior.
- Why Spring Boot Kafka Consumers Generate Duplicate Reports — how duplicate report generation appears when consumer behavior is misunderstood.
- Kafka Lag vs PostgreSQL Writes: What Slowed the Consumer Down — a benchmark where database writes affected lag and drain time.
- Spring Boot Kafka Producer and Consumer Setup That Avoids Duplicate Messages — setup notes for producer and consumer boundaries.
- Spring Boot Tutorial with Kafka and Apache Avro Integration — schema-based messaging for teams that need stronger contracts.
- Kafka Server on Docker with WebUI for Monitoring — a practical local stack for inspecting topics and consumers.
Frequently asked questions
Why does Spring Boot save to the database but the Kafka event never arrives?
Writing to the database and sending to Kafka are two separate operations, so one can succeed while the other fails. The transactional outbox pattern writes the event to an outbox table in the same database transaction and relays it to Kafka afterwards. See Spring Boot Saved the Order. Kafka Never Received the Event.
Why does a Kafka consumer process the same message twice?
Kafka consumers get at-least-once delivery by default: if a consumer fails or rebalances after processing but before committing the offset, the message is delivered again. Make the processing idempotent, for example by recording processed event IDs.
Can Kafka consumer lag look healthy while a partition is stuck?
Yes. Total lag across a topic can stay low while a single partition stops moving. Monitor lag per partition and alert on partitions whose offset stops advancing.
New articles are published on Medium first. Subscribe to the newsletter to get production lessons by email.