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 v1
message_size
int32 · 4B
api_key
int16 · 2B
api_version
int16 · 2B
correlation_id
int32 · 4B
client_id?
nullable string · int16 length
ProduceRequest v5
TransactionalId?
string
Acks
int16 · 2B
TimeoutMs
int32 · 4B
Name
string
Index
int32 · 4B
Records?
records
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>" }] }] }