Skip to content

MINOR: Correct exception naming and preserve original headers in DLQ#21378

Merged
chia7712 merged 2 commits intoapache:4.2from
unknowntpo:fix-dlq-headers-4.2-backport
Jan 31, 2026
Merged

MINOR: Correct exception naming and preserve original headers in DLQ#21378
chia7712 merged 2 commits intoapache:4.2from
unknowntpo:fix-dlq-headers-4.2-backport

Conversation

@unknowntpo
Copy link
Contributor

@unknowntpo unknowntpo commented Jan 31, 2026

This is a backport of PR #21370, with an additional checkstyle fix
(adding a final keyword to make checkstyle works in 4.2 branch).


This patch fixed two mismatch between

KIP-1034
and the actual implementation:

  • Incorrect value of HEADER_ERRORS_EXCEPTION_NAME, it should be the
    name of the thrown exception, not exception's String representation.
  • Original headers from record that causes exception should be added to
    dlq record headers.

References:

KIP-1034

Reviewers: Lucas Brutschy lbrutschy@confluent.io, Chia-Ping Tsai
chia7712@gmail.com

…pache#21370)

This patch fixed two mismatch between

[KIP-1034](https://cwiki.apache.org/confluence/display/KAFKA/KIP-1034%3A+Dead+letter+queue+in+Kafka+Streams#KIP1034:DeadletterqueueinKafkaStreams-ProposedChanges)
and the actual implementation:

- Incorrect value of `HEADER_ERRORS_EXCEPTION_NAME`, it should be the
name of the thrown exception, not exception's String representation.
- Original headers from record that causes exception should be added to
dlq record headers.

References:
- apache#17942 (comment)
- apache#17942 (comment)
-

[KIP-1034](https://cwiki.apache.org/confluence/display/KAFKA/KIP-1034%3A+Dead+letter+queue+in+Kafka+Streams#KIP1034:DeadletterqueueinKafkaStreams-ProposedChanges)

Reviewers: Lucas Brutschy <lbrutschy@confluent.io>
@chia7712 chia7712 merged commit c2173c9 into apache:4.2 Jan 31, 2026
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants