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
Request Header · flexible
message_size
int32 · 4B
api_key
int16 · 2B
api_version
int16 · 2B
correlation_id
int32 · 4B
client_id
string (compact)
tagged
var
ProduceRequest v9
TransactionalId?
string (compact)
Acks
int16 · 2B
TimeoutMs
int32 · 4B
tagged
var
Name
string (compact)
tagged
var
Index
int32 · 4B
Records?
records (compact)
tagged
var
Schema & Example
Schema { "TransactionalId": string?, "Acks": int16, "TimeoutMs": int32, "TopicData": [{ "Name": string, "PartitionData": [{ "Index": int32, "Records": records? }] }] }
Example { "TransactionalId": "tx-orders-001", "Acks": -1, "TimeoutMs": 30000, "TopicData": [{ "Name": "orders", "PartitionData": [{ "Index": 3, "Records": "<binary>" }] }] }