What is Produce?
A producer request can carry record batches for multiple partitions. Acknowledgement behavior depends on acks, replication and the minimum ISR: acks=all waits for the required in-sync replication, while acks=1 can acknowledge before followers replicate the write. Retries and application error handling still matter; a larger batch does not imply a proportional throughput gain.
Wire Diagram
Response Header v1 · flexible
message_size
int32 · 4B
correlation_id
int32 · 4B
tagged
var
ProduceResponse v11
ThrottleTimeMs
int32 · 4B
tagged
var
Name
string (compact)
tagged
var
Index
int32 · 4B
ErrorCode
int16 · 2B
BaseOffset
int64 · 8B
LogAppendTimeMs
int64 · 8B
LogStartOffset
int64 · 8B
ErrorMessage?
string (compact)
tagged
var
BatchIndex
int32 · 4B
BatchIndexErrorMessage?
string (compact)
tagged
var
Known optional payloads inside tagged buffer
tag 0: CurrentLeader
LeaderIdAndEpoch
Known optional payloads inside tagged buffer
tag 0: NodeEndpoints
[]NodeEndpoint
Schema & Example
Schema { "Responses": [{ "Name": string, "PartitionResponses": [{ "Index": int32, "ErrorCode": int16, "BaseOffset": int64, "LogAppendTimeMs": int64, "LogStartOffset": int64, "RecordErrors": [{ "BatchIndex": int32, "BatchIndexErrorMessage": string? }], "ErrorMessage": string?, "CurrentLeader": { "LeaderId": int32, "LeaderEpoch": int32 } }] }], "ThrottleTimeMs": int32, "NodeEndpoints": [{ "NodeId": int32, "Host": string, "Port": int32, "Rack": string? }] }
Illustrative values (not encoded bytes) { "Responses": [{ "Name": "orders", "PartitionResponses": [{ "Index": 3, "ErrorCode": 0, "BaseOffset": 284729, "LogAppendTimeMs": 1711648200000, "LogStartOffset": 284729, "RecordErrors": [{ "BatchIndex": 0, "BatchIndexErrorMessage": "NETWORK_EXCEPTION" }], "ErrorMessage": null, "CurrentLeader": { "LeaderId": 1, "LeaderEpoch": 17 } }] }], "ThrottleTimeMs": 0, "NodeEndpoints": [{ "NodeId": 1, "Host": "broker-1.kafka.local", "Port": 9092, "Rack": "us-east-1a" }] }