[receiver/kafka] Remove messageHeaders abstraction since Sarama is deprecated#46835
Merged
Conversation
…precated Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the now-unnecessary Kafka message/header abstraction layer in kafkareceiver after Sarama removal, using franz-go types (*kgo.Record and []kgo.RecordHeader) directly.
Changes:
- Replaced the
kafkaMessageinterface with*kgo.Recordacross receiver/consumer code paths. - Replaced
messageHeaderswith[]kgo.RecordHeader, updating header extraction/context propagation accordingly. - Removed the wrapper/adapter implementation file and updated associated tests/benchmarks.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| receiver/kafkareceiver/kafka_receiver_bench_test.go | Benchmarks updated to use []kgo.RecordHeader directly. |
| receiver/kafkareceiver/kafka_receiver.go | Receiver pipeline now consumes *kgo.Record; header helpers updated to operate on []kgo.RecordHeader. |
| receiver/kafkareceiver/consumer_message.go | Removed now-obsolete message/header abstraction wrappers. |
| receiver/kafkareceiver/consumer_franz_test.go | Tests updated for new consumeMessageFunc signature (*kgo.Record). |
| receiver/kafkareceiver/consumer_franz.go | Consumer now passes *kgo.Record directly (no wrapper). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Member
Author
|
/rerun |
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.
Description
The
messageHeadersinterface,kafkaMessageinterface, and related wrapper types were designed to abstract over Sarama and franz-go record types. Now that Sarama has been fully removed, and only the franz-go implementation remains, we should remove that abstraction.Replaced
kafkaMessagewith*kgo.Recorddirectly, replacedmessageHeaderswith[]kgo.RecordHeader.Link to tracking issue
Fixes #46816
Testing
Updated unit tests and re-run the benchmark tests to get the possible improvements with the results below.