Skip to content

Add RawProduce API - #1233

Merged
apacker merged 32 commits into
mainfrom
raw-produce-api
Dec 5, 2023
Merged

Add RawProduce API#1233
apacker merged 32 commits into
mainfrom
raw-produce-api

Conversation

@apacker

@apacker apacker commented Nov 16, 2023

Copy link
Copy Markdown
Contributor

This PR adds a new RawProduce API to the client. The background/context for this API is: we have an internal system that does buffering of Kafka messages on disk, and needs to flush that data to Kafka without having to decode/re-encode the data and incur a 2x cost of compression/encoding. In this context, it would be optimal to be able to pass a raw/pre-encoded RecordSet to the Produce API, hence the introduction of a new RawProduce interface.

Notes:

  • The existing ProduceResponse type is reused as there's no reason to introduce a new response type.
  • Since request/response types and their resulting encodings are linked directly to an API key, I've introduced a mechanism to be able to override types via a OverrideTypeMessage interface.

@apacker
apacker marked this pull request as ready for review November 16, 2023 17:57

@petedannemann petedannemann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 great work, two small comments for now. I'll think this over a bit more and re-review later this week

Comment thread protocol/protocol.go Outdated
Comment thread protocol/protocol.go Outdated
@apacker
apacker merged commit edf45f6 into main Dec 5, 2023
@apacker
apacker deleted the raw-produce-api branch December 5, 2023 19:39
ashishkf pushed a commit to kloudfuse/kafka-go that referenced this pull request Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants