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
Request Header v2 · flexible
message_size
int32 · 4B
api_key
int16 · 2B
api_version
int16 · 2B
correlation_id
int32 · 4B
client_id?
nullable string · int16 length
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? }] }] }
Illustrative values (not encoded bytes) { "TransactionalId": "tx-orders-001", "Acks": -1, "TimeoutMs": 30000, "TopicData": [{ "Name": "orders", "PartitionData": [{ "Index": 3, "Records": "<binary>" }] }] }