Skip to content

22.2. How do you debug a Kafka consumer that is not receiving messages?

Answer: I would troubleshoot the problem from the outside in rather than changing random Kafka settings. First I identify the symptom precisely: producer errors, consumer lag, rebalance loops, broker unavailability, disk pressure, or network latency. Then I check cluster health, broker logs, controller or KRaft metadata state, topic and partition state, under-replicated partitions, ISR size, and relevant producer or consumer metrics. After that I trace the application path: DNS and network connectivity, authentication, topic permissions, serialization, offsets, downstream dependencies, and processing time. I also compare the timing of the incident with deployments, traffic spikes, broker failures, storage saturation, or configuration changes. Once I isolate the bottleneck, I change the smallest safe number of variables and validate the effect with metrics. In production, I prefer a reversible mitigation first, followed by a root-cause fix and a post-incident test.

Interview close: I would make the trade-off explicit, measure it, and document the operational impact before deploying it.