Quick revision
The short answer
A dead-letter topic only helps if someone is responsible for it, so the policy starts with ownership: every DLT has an owning team, an alert on its arrival rate and a target time to triage. On top of that the platform provides standard headers on every dead-lettered record, shared tools to inspect, fix and replay, a distinction between expected rejects and bugs with DLT volume reported per team, and retention that fits both triage time and data protection rules.
What to remember
In this answer, we saw that DLTs fill up because publishing to them feels like handling the error. The policy fixes that by giving every DLT an owner, an arrival-rate alert and a triage target, by standardising headers such as original topic, partition, offset, exception and service version, and by providing shared tools to inspect, fix and replay. Classifying expected rejects apart from bugs and reporting DLT volume per team makes the work visible, and retention is set to cover triage time while respecting data protection rules.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
A dead-letter topic only helps if someone is responsible for it, so the policy starts with ownership: every DLT has an owning team, an alert on its arrival rate and a target time to triage. On top of that the platform provides standard headers on every dead-lettered record, shared tools to inspect, fix and replay, a distinction between expected rejects and bugs with DLT volume reported per team, and retention that fits both triage time and data protection rules.
Why this question is asked
Dead-letter topics are easy to create and easy to forget. A team adds one to stop a consumer from getting stuck, the incident is closed, and the DLT quietly collects records for years. Each of those records was a business event that did not happen: an order not shipped, a payment not recorded. Interviewers ask this leadership question to see whether we treat a DLT as a work queue with owners or as a bin. In this answer, we will look at why DLTs fill up unnoticed, then build the policy piece by piece: ownership and alerts, standard headers, shared replay tooling, classification and metrics, and retention, and finally how to roll it out across many teams.
1Why Dead-Letter Topics Fill Up Unnoticed
A dead-letter topic, or DLT, is a Kafka topic where a consumer parks records it could not process, so that the partition can keep moving. Spring Kafka's DeadLetterPublishingRecoverer creates exactly this pattern with one line of configuration. The problem is not technical. Publishing to the DLT feels like handling the error, so nobody adds an alert, nobody is named as owner, and there is no tool to do anything with the records except read them by hand.
Over time, the DLT mixes two very different things. Some records are expected rejects, such as a form submission with an invalid postcode, which may be fine to discard. Others are symptoms of bugs, such as a new event version the consumer cannot read, which may represent thousands of customers affected. When both sit in one unwatched topic with millions of records, the bugs are invisible.
2Ownership, Alerts and a Triage Target
The first rule is that every DLT has an owner: the team that owns the consumer that wrote to it. Only they can tell whether a record is bad input or a defect in their code. The topic's owner is recorded in the platform's topic metadata, and creating a DLT without one fails the platform's checks.
The second rule is an alert on the arrival rate, not on the total size. A DLT that receives 3 records a day and suddenly receives 400 in an hour almost always means a bug or a broken producer, and the owner should know within minutes. A slow trickle of expected rejects can go to a daily report rather than a page.
The third rule is a target time to triage, for example one business day for normal topics and one hour for payment topics. Triage means looking at each new kind of failure and deciding: fix the consumer and replay, fix the data and replay, or discard with a recorded reason. The target turns the DLT from a bin into a queue of work with a service level.
- Record arrives in orders.DLTheaders say where it came from and why
- Arrival-rate alert or daily reportthe owning team is notified
- Expected reject (invalid input)?YesDiscard or return to sender, with a reasonNoTreat as a bug
- Fix the consumer or the datadeploy, or correct the payload
- Replay with the shared toolto the original topic or a retry topic
- Record the outcomecounts feed the per-team metric
6 steps in order. Play them, or step through them one at a time.
3Standard Headers So Triage Is Possible
Triage is impossible if a DLT record says only 'something failed'. The platform defines a standard set of headers that every service adds when dead-lettering. Spring Kafka's recoverer already adds the original topic, partition, offset and timestamp, and the exception class, message and stack trace. We add the consumer's service name and version, the consumer group and a failure category, so a reviewer can answer 'which deployment broke this?' at a glance.
Putting this in a shared library or starter means teams get it by default instead of each inventing their own names.
4Shared Tooling to Inspect, Fix and Replay
If replaying a record requires writing a script, teams will not do it. The platform provides one tool, a small web console or a CLI, that lists DLT records with their headers, groups them by exception type and service version, lets an authorised person edit a payload, and republishes selected records to the original topic or to a retry topic. It keeps the original key so the replay lands on the same partition, and it logs who replayed what.
The tool should refuse to replay to a consumer that is not idempotent, or at least warn. Replay is a deliberate repeat of processing, so the consumer must handle a record it may have partly processed before.
5Expected Rejects, Bugs and a Quality Metric
Not every DLT record is a failure of the team. When a consumer rejects input that is genuinely invalid, the right outcome may be to tell the producer or the user, not to replay. So we ask teams to classify failures at the point of dead-lettering, for example REJECT for validation errors and DEFECT for everything else, and to route expected rejects to a separate topic or category.
Then the platform reports DLT volume per team and per category every week: arrivals, records triaged within target and records older than the target. Defects per million processed records becomes a quality metric that appears next to lag and error rate on each team's dashboard. That makes the forgotten DLT visible to the people who can prioritise fixing it.
| Team / topic | New records | Category | Older than target |
|---|---|---|---|
orders / orders.DLT | 1,240 | 1,200 REJECT, 40 DEFECT | 0 |
billing / invoices.DLT | 3 | 3 DEFECT | 0 |
search / products.DLT | 2,100,000 | unclassified | 2,100,000 |
6Retention and Data Protection
Finally, DLT retention must be set on purpose. It must be longer than the triage target plus a safety margin, or records expire before anyone looks at them. But DLT records often contain personal data, and keeping them forever can break data protection rules, such as a requirement to delete a customer's data within 30 days of a request. A sensible default is 14 days for ordinary topics and a documented, shorter or encrypted setup for topics with personal or payment data.
For the existing millions of records, we would not try to triage them all. We would sample them to find the main failure causes, fix those, and then purge the old backlog with the owner's agreement, starting the new policy with a clean slate.
7Follow-up questions
How would you roll this policy out across many teams?
Start with the shared library and the tool, because a policy without tooling only adds work. Then pilot with two or three teams that have the biggest DLTs, learn what slows triage down, and adjust. After that, make the rules part of topic creation: a DLT needs an owner, an alert and a retention value. Report the per-team metric openly, and review it in the regular operations meeting rather than using it to blame.
Should the platform team own all DLTs centrally?
No. A central team can run the tooling and the reports, but it cannot tell whether an order event is invalid or the order service has a bug. Ownership must sit with the consumer's team, with the platform making the work easy and visible.
What about DLTs for topics that receive no traffic for weeks?
The same rules apply, but the arrival alert does the work: a quiet DLT costs nothing, and the first unexpected record still reaches the owner. The weekly report shows it as zero, which is the goal.
8Conclusion
In this answer, we saw that DLTs fill up because publishing to them feels like handling the error. The policy fixes that by giving every DLT an owner, an arrival-rate alert and a triage target, by standardising headers such as original topic, partition, offset, exception and service version, and by providing shared tools to inspect, fix and replay. Classifying expected rejects apart from bugs and reporting DLT volume per team makes the work visible, and retention is set to cover triage time while respecting data protection rules.
Open with
I'd treat dead-letter topics as queues of unfinished business work, not as a bin, and the policy would follow from that. First, every DLT has an owner, which is the team that owns the consumer, because only they can tell bad input from a bug.
Then, if they want more
The owner gets an alert on the arrival rate, so a sudden spike pages someone within minutes, and there's a target time to triage, for example a business day, or an hour for payments.
Second, the platform standardises headers on dead-lettered records: original topic, partition and offset, the exception, and the service name and version, shipped in a shared library so every team gets them by default. Third, we provide one shared tool to inspect, group, fix and replay records to the original topic with the original key, and replay assumes idempotent consumers.
Fourth, teams classify expected rejects, like validation failures, separately from defects, and we report DLT arrivals and backlog per team every week as a quality metric next to lag and error rate. Finally, retention is set on purpose: long enough to triage, but within data protection rules, since DLT records often hold personal data.
For today's millions of records, I'd sample to find the main causes, fix them, and purge the backlog with the owners' agreement.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Apache Kafka documentation, Spring for Apache Kafka reference
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Many teams' dead-letter topics fill up with millions of records that nobody looks at....": https://scrivio-interview-library.netlify.app/spring-boot/kafka/8018d760fc/