Skip to content

feat(producer): add Produce v8 request/response support#3540

Merged
dnwe merged 1 commit into
mainfrom
dnwe/produce-v8
May 16, 2026
Merged

feat(producer): add Produce v8 request/response support#3540
dnwe merged 1 commit into
mainfrom
dnwe/produce-v8

Conversation

@dnwe
Copy link
Copy Markdown
Collaborator

@dnwe dnwe commented May 14, 2026

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.

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>
@dnwe dnwe added the feat label May 14, 2026
Copy link
Copy Markdown
Collaborator

@hindessm hindessm left a comment

Choose a reason for hiding this comment

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

LGTM. Minor comment about something that surprised me reading the code.

Comment thread produce_response.go
// 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 {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

@dnwe dnwe merged commit d46d7b5 into main May 16, 2026
18 checks passed
@dnwe dnwe deleted the dnwe/produce-v8 branch May 16, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants