feat(producer): add Produce v8 request/response support#3540
Merged
Conversation
Adds protocol support for KIP-467 (Kafka 2.4.0) which extends the Produce response with per-record errors and a batch-level error message, and bumps the negotiated Produce version to 8 when the configured Kafka version is at least 2.4.0. Also makes MockBroker's default request handler match the queued response version to the request version, so tests using broker.Returns() don't have to manually bump version numbers. Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
hindessm
approved these changes
May 16, 2026
Collaborator
hindessm
left a comment
There was a problem hiding this comment.
LGTM. Minor comment about something that surprised me reading the code.
| // ProduceResponseRecordError identifies a record within a produced batch that | ||
| // caused the whole batch to be dropped, along with the per-record error | ||
| // message. Added in Produce response v8 (KIP-467). | ||
| type ProduceResponseRecordError struct { |
Collaborator
There was a problem hiding this comment.
I was a little surprised that you didn't create encode and decode methods for this struct. I thought that was the typical pattern followed by the protocol code. (However, 20% of the similar structs don't follow this pattern either so perhaps it is already too late for consistency here.)
Collaborator
Author
There was a problem hiding this comment.
Yeah I did wonder whether to or not, but with only two fields it was easier to just do inline. Maybe I’ll do a follow-up PR to do some of that
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.
Adds protocol support for KIP-467 (Kafka 2.4.0) which extends the Produce response with per-record errors and a batch-level error message, and bumps the negotiated Produce version to 8 when the configured Kafka version is at least 2.4.0.
Also makes MockBroker's default request handler match the queued response version to the request version, so tests using broker.Returns() don't have to manually bump version numbers.