Retrying A Permanent Error

A consumer retries in place with backoff and no attempt cap. max.poll.interval.ms is at its default of 5 minutes.

for (ConsumerRecord<byte[], byte[]> r : records) {
  while (true) {
    try { handler.process(r); break; }
    catch (Exception e) {
      log.warn("retrying", e);
      Thread.sleep(backoff.next());   // capped at 30s
    }
  }
}

A producer ships a record whose payload fails schema validation inside handler.process. Describe the blast radius.

A

Thread.sleep inside the record loop does not block heartbeats, so the consumer keeps its assignment and the only cost is that one partition falls behind by the length of the outage

B

The record can never succeed, so the loop never breaks, the consumer stops calling poll, the group evicts it after max.poll.interval.ms, another member picks up the same partition and hits the same record: one malformed payload puts the whole group into a rebalance loop

C

The consumer retries that record forever and the partition it owns stalls, but the other partitions in the group keep making progress because each partition is handled on its own thread

D

The consumer retries until the record ages past the topic's retention window, at which point the fetch returns nothing for that offset and the loop exits on its own