What is Produce?
Every producer sends this for every message publish, making it the dominant write path. With acks=all, the broker waits for all ISR replicas to acknowledge before responding; acks=1 returns after the leader writes locally; acks=0 is fire-and-forget with no loss detection.
Wire Diagram
Response Header · flexible
message_size
int32 · 4B
correlation_id
int32 · 4B
tagged
var
ProduceResponse v12
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
LeaderId
int32 · 4B
LeaderEpoch
int32 · 4B
tagged
var
NodeId
int32 · 4B
Host
string (compact)
Port
int32 · 4B
Rack?
string (compact)
tagged
var
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? }] }
Example { "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" }] }