---
title: "Kafka share group poison pill: delivery limit and archiving"
description: "A record that is never acked is redelivered until the delivery limit of 3. Then the Kafka broker archives it and the other records drain past it."
url: https://monedula.dev/kafka-simulator/scenarios/share-group-poison-pill/
---

# Kafka share group poison pill: delivery limit and archiving

Scenario 11.0.5 · Share group poison pill. Share groups · Advanced · about 3 min · Apache Kafka 4.3.

A record the consumer never acks is redelivered until the delivery cap, then archived automatically - while the rest drain (KIP-932).

Run it: https://monedula.dev/kafka-simulator/playground/?scenario=11.0.5

## What you start with

A "poison pill" is a record that repeatedly fails processing. In EXPLICIT ackMode the consumer leaves offset 0 un-acked, so its acquisition lock keeps expiring: each expiry redelivers the record and bumps its delivery count. The share-group delivery limit (deliveryLimit=3) caps how many times a record may be handed out - once the count reaches the limit the broker ARCHIVES the record on the next lock expiry instead of redelivering it again, and the remaining records (acked normally) drain past it.

## Step by step

1. **Cluster ready · idle** (t+0.000s): One partition, a share group with a single consumer w1 in explicit ack mode, delivery limit 3. Press ▶. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=11.0.5&t=0)
2. **Poison redelivered** (t+1.300s): Offset 0 is never acked, so its acquisition lock keeps expiring and the record is redelivered - its delivery count climbs each attempt (now 2). [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=11.0.5&t=1)
3. **Poison archived at the cap** (t+2.300s): The delivery count reached the limit (3), so on the next lock expiry the broker archives offset 0 automatically - the poison pill is skipped, not retried forever. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=11.0.5&t=2)
4. **Drained around the poison** (t+3.800s): Offsets 1 and 2 were acked and drained; the poison was archived, not blocking the queue. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=11.0.5&t=3)

## The takeaway

The delivery limit stops a poison pill from blocking the queue forever - once a record has been delivered the maximum number of times the broker archives it automatically on the next lock expiry, protecting throughput with no manual reject required.

## Further reading

- [KIP-932 on the Apache Kafka wiki](https://cwiki.apache.org/confluence/display/KAFKA/KIP-932%3A+Queues+for+Kafka)
