Question 35 of 50
What is DLQ or Dead Letter Topic?
Question
"What is a DLQ (Dead Letter Queue/Topic)?"
What the interviewer wants to assess
Understanding of the DLQ's role as a failure-isolation mechanism: not just "where messages with errors end up."
Resposta rápida
DLQ (Dead Letter Topic, in Kafka's vocabulary) is a separate topic where messages that repeatedly failed are published once retry attempts are exhausted, allowing manual investigation without blocking processing of the following messages.
Resposta nível Sênior
The DLQ's role is to isolate the poison pill effect: without it, a message that fails indefinitely would stall processing of everything after it in the same partition. By moving the problematic message to a separate topic once retry attempts run out, the main consumer keeps processing the following messages normally. The DLQ doesn't fix the problem: it only isolates it for later investigation, whether that's manual reprocessing after fixing the root cause, or simply discarding it, if the message is genuinely invalid.
In-depth explanation
See "DLQ in Kafka: it's not native" in Chapter 9.
Exemplo financeiro
A BoletoGerado event with a malformed tax ID fails all 3 configured retry attempts and is published to
boletos.gerados.DLT; meanwhile, the following invoices in the same partition keep being processed with
no delay.
"The DLQ fixes the problem automatically"
The DLQ only isolates the problematic message: it doesn't try to fix or reprocess it on its own. Someone (or some process) needs to investigate the failure's cause and decide what to do with the isolated message.
Pode vir a seguir
Likely follow-ups: "does Kafka have native DLQ?" and "what is a Poison Pill?".
Related chapters