[fix][io][kca] kafka headers silently dropped - #25325
Merged
Merged
Conversation
efcasado
force-pushed
the
kca-headers-silently-dropped
branch
from
March 15, 2026 19:37
b5388b0 to
1ce5781
Compare
shibd
approved these changes
Mar 16, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #25325 +/- ##
============================================
- Coverage 72.97% 72.75% -0.22%
+ Complexity 34347 34232 -115
============================================
Files 1954 1954
Lines 154715 154725 +10
Branches 17704 17708 +4
============================================
- Hits 112898 112575 -323
- Misses 32816 33072 +256
- Partials 9001 9078 +77
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
coderzc
pushed a commit
to coderzc/pulsar
that referenced
this pull request
Mar 19, 2026
Technoboy-
pushed a commit
that referenced
this pull request
Mar 19, 2026
priyanshu-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Apr 1, 2026
(cherry picked from commit 45022c4)
priyanshu-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Apr 1, 2026
(cherry picked from commit 45022c4)
priyanshu-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Apr 2, 2026
(cherry picked from commit 45022c4)
priyanshu-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Apr 3, 2026
(cherry picked from commit 45022c4)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The current implementation of the Kafka Connect adaptor silently discards headers from the Kafka Connect SourceRecord instead of mapping them to Pulsar message properties. This is particularly impactful when using Debezium's Outbox Event Router SMT with the table.fields.additional.placement option, which allows outbox table columns to be placed in the
header,envelope, orpartitionof the resulting record. Columns configured with header placement are silently ignored because the adaptor never propagates Connect record headers to Pulsar message properties. Since Kafka Connect headers and Pulsar message properties are semantically equivalent (string key/value metadata outside the payload), the expected behavior is a direct mapping.A similar issue was previously identified for
pulsar-io-kafkaand addressed in #17829. However,kafka-connect-adaptorwas not covered by that fix and still silently discards Kafka Connect SourceRecord headers.Modifications
AbstractKafkaConnectSourcepreviously returned a hard-coded empty map fromgetProperties(), causing all Kafka Connect headers to be silently dropped. This change maps headers from the transformedSourceRecordto Pulsar message properties, preserving metadata that would otherwise be lost in transit (eg. columns placed in header position via Debezium's Outbox Event Router SMT andtable.fields.additional.placement).Verifying this change
This change added tests and can be verified as follows:
KafkaConnectSourceTesttest suite with an additional test to confirm Kafka headers are correctly propagated to the resulting record.Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: efcasado#2