Configuring for high availability, eliminating duplicates from retries and rebalances, messages larger than 1 MB, lagging consumer groups, surviving broker failures, consistency with multiple consumers, key metrics and throughput troubleshooting, leader election, slow rebalances, how data can still be lost, compacted topics, and when ordering breaks.
Published September 25, 2026
These are the "you're on call" questions. Strong answers name the specific configuration or metric (min.insync.replicas, UnderReplicatedPartitions, max.poll.interval.ms), explain why it helps, and state the trade-off it introduces.
Short answer:
| Area | Setting |
|---|---|
| Replication | replication.factor=3 (default.replication.factor=3) |
| Durable writes | Producers acks=all + topic min.insync.replicas=2 |
| Safe elections | unclean.leader.election.enable=false (the default): never elect an out-of-sync replica |
| Placement | broker.rack = the AZ, so replicas land in different zones |
| Control plane | 3 or 5 KRaft controllers, across zones |
| Operations | Monitor under-replicated or offline partitions, rebalance with Cruise Control, rolling upgrades one broker at a time |
| Clients | Several bootstrap servers, sensible retries and timeouts |
Key points to cover:
min.insync.replicas=2, you can lose one broker and keep both reads and acks=all writes. Losing two stops writes (safety over availability).Short answer:
ConsumerRebalanceListener or Spring Kafka's handling).Common trap: "set exactly-once and duplicates disappear". That's only within Kafka. External side effects still need idempotency.
Short answer: Prefer not to put large payloads into Kafka:
If you really must raise the limit, raise it consistently everywhere:
max.message.bytes (or the broker's message.max.bytes);max.request.size (and buffer.memory);max.partition.fetch.bytes / fetch.max.bytes;replica.fetch.max.bytes.Otherwise, replication or consumption fails.
Key points to cover:
Short answer:
kafka-consumer-groups.sh --describe, Burrow, or Prometheus exporters).max.poll.interval.ms gets consumers kicked out repeatedly.Learn it in depth → Metrics & Monitoring
Short answer: It's mostly automatic, if the cluster was configured correctly beforehand:
min.insync.replicas 2, writes continue with two replicas.Short answer: It depends on what "several consumers" means:
Common trap: saying consumer groups give "exactly once". They give one consumer per record per group, but redelivery can still happen.
Short answer:
UnderReplicatedPartitions, OfflinePartitionsCount, ActiveControllerCount;RequestMetrics produce/fetch totalTimeMs);RequestHandlerAvgIdlePercent and NetworkProcessorAvgIdlePercent (saturation);request-latency.Troubleshooting a throughput drop: check what changed (deploys, traffic mix, a new large-message producer), then look for:
acks=all;Short answer:
Key points to cover:
Short answer: Classic ("eager") rebalances are stop-the-world. Every member revokes all its partitions, commits, waits for the slowest member to rejoin, then gets a new assignment. Slow members (long processing, beyond max.poll.interval.ms), large groups, and state restoration (in Streams) all make it worse.
To shorten them:
CooperativeStickyAssignor (incremental rebalancing): only the moved partitions pause.group.instance.id): restarts during deployments don't trigger rebalances at all, within session.timeout.ms.poll() loops fast, or reduce max.poll.records.Short answer: Yes:
acks=0 or acks=1: the leader acknowledges, then dies before followers replicate.min.insync.replicas=1: acks=all degenerates to "leader only" when followers fall behind.send() without checking the callback.retention.ms is deleted before a slow consumer reads it.Key points to cover:
acks=all + min.insync.replicas=2 + replication factor 3 across AZs, no unclean elections, checked callbacks, commit after processing, and retention sized for the worst consumer outage.Short answer: Use log compaction (cleanup.policy=compact) when consumers need the latest state per key, not the full history:
A new consumer can bootstrap the full current state by reading the topic from the start.
Trade-offs:
null values, retained for delete.retention.ms).compact,delete combines compaction with time-based retention.Short answer: Ordering is guaranteed only within a single partition, for a single producer's successful writes. It can break when:
hash(key) % partitions shifts, so new records for a key land in a different partition from the old ones.max.in.flight.requests.per.connection > 1: a failed batch retried after a later batch can reorder records. Idempotence (the default) prevents this.@Async) without per-key serialisation.Q: What does "under-replicated partitions" mean, and why alert on it? A: Some followers are behind the leader, so you have fewer copies than configured. Another failure could then cause unavailability or data loss. Common causes are slow disks or networks, overloaded brokers, and a broker that's down.
Q: How do you choose retention.ms?
A: Longer than your worst plausible consumer outage, plus the reprocessing window, balanced against disk cost. Tiered storage (KIP-405) makes long retention affordable by offloading old segments to object storage.
Q: What is MirrorMaker 2 used for? A: Replicating topics (and consumer-group offsets) between clusters, for disaster recovery, migrations, or active-active and hub-and-spoke topologies across regions.
Q: How do you reprocess events from yesterday?
A: Reset the group's offsets to a timestamp (kafka-consumer-groups.sh --reset-offsets --to-datetime ..., with the group stopped), or run a separate consumer group from that point. Make sure the processing is idempotent first.