---
title: "Kafka 4.4 share group dead-letter queue (KIP-1191)"
description: "A share consumer never acks offset 0. At the delivery limit of 3 the Kafka broker writes it to dlq.orders with __dlq.errors headers, then archives it."
url: https://monedula.dev/kafka-simulator/scenarios/share-group-dead-letter-queue/
---

# Kafka 4.4 share group dead-letter queue (KIP-1191)

Scenario 22.1.10 · Share group dead-letter queue. Share groups · Advanced · about 3 min · Apache Kafka 4.4.

The poison pill from 22.1.5 is no longer just skipped: Kafka 4.4 writes it to the dead-letter topic dlq.orders before archiving it (KIP-1191).

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

## What you start with

Kafka 4.4 adds dead-letter queues to share groups (KIP-1191; a new 4.4 cluster has the feature level it needs, share.version=2). The group sets errors.deadletterqueue.topic.name=dlq.orders, and dlq.orders was created up front with errors.deadletterqueue.group.enable=true, since the broker creates a missing dead-letter topic only when errors.deadletterqueue.auto.create.topics.enable is on. Offset 0 is a poison pill: w1 never acknowledges it, so its acquisition lock expires and it is redelivered until its delivery count reaches the limit (3), as in 22.1.5. Then the broker does not archive it straight away: the record goes ARCHIVING, the broker writes it to dlq.orders, and only then is it ARCHIVED.

## Step by step

1. **Cluster ready · idle** (t+0.000s): Three orders go to the one partition of orders. Share group sg1 (one consumer w1, explicit acks, delivery limit 3) has a dead-letter topic: errors.deadletterqueue.topic.name=dlq.orders. Press ▶. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=22.1.10&t=0)
2. **Poison redelivered** (t+1.300s): w1 acknowledged offsets 1 and 2 but never offset 0, so its acquisition lock keeps expiring and the record is redelivered. Its delivery count is now 2 of 3. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=22.1.10&t=1)
3. **Archiving, not archived** (t+2.300s): The lock expired again with the delivery count at the limit (3). Because the group has a dead-letter topic, offset 0 goes ARCHIVING instead of ARCHIVED, and SPSO stays at 0 while the broker writes it to dlq.orders. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=22.1.10&t=2)
4. **Dead letter in dlq.orders** (t+2.400s): The broker wrote offset 0 to dlq.orders partition 0 at offset 0: no key or value, only __dlq.errors headers naming group sg1, topic orders, partition 0, offset 0, delivery count 3 and the reason, Offset delivery count exceeded the threshold. Only then is it ARCHIVED, and SPSO moves to 3. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=22.1.10&t=3)

## The takeaway

With a dead-letter topic the delivery count limit no longer loses the poison pill: the record still leaves the queue so offsets 1 and 2 drain past it, but a copy waits in dlq.orders with headers naming the group, topic, partition, offset, delivery count and why it failed. Set errors.deadletterqueue.copy.record.enable=true to copy the key and value too. A missing or misconfigured dead-letter topic fails the write, and the record is archived anyway.

## Configs in this scenario

- [`errors.deadletterqueue.topic.name`](https://kafka.apache.org/44/configuration/group-configs/#groupconfigs_errors.deadletterqueue.topic.name): The dead-letter topic of a share group, new in Kafka 4.4: a record the consumer rejects, or one that reaches the delivery count limit, is written there before it is archived (empty by default, meaning no dead-letter queue).
- [`errors.deadletterqueue.group.enable`](https://kafka.apache.org/44/configuration/topic-configs/#topicconfigs_errors.deadletterqueue.group.enable): A topic config that lets share groups write dead letters to the topic (default false); a dead-letter write to a topic without it fails, and the record is archived anyway.
- [`errors.deadletterqueue.auto.create.topics.enable`](https://kafka.apache.org/44/configuration/broker-configs/#brokerconfigs_errors.deadletterqueue.auto.create.topics.enable): Whether the broker creates a missing share-group dead-letter topic itself, with errors.deadletterqueue.group.enable=true (default false, so the topic has to exist first).
- [`errors.deadletterqueue.copy.record.enable`](https://kafka.apache.org/44/configuration/group-configs/#groupconfigs_errors.deadletterqueue.copy.record.enable): Whether a share-group dead-letter record also copies the original key and value (default false, so it carries only headers naming the group, topic, partition, offset and delivery count).

## Further reading

- [KIP-1191 on the Apache Kafka wiki](https://cwiki.apache.org/confluence/display/KAFKA/KIP-1191%3A+Dead-letter+queues+for+share+groups)

## Kafka proposals behind this scenario

- [KIP-1191 explained: dead-letter queues for share groups](https://monedula.dev/kafka/kips/kip-1191/)
