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.
| Version | Kafka | Changes |
|---|---|---|
| ProduceRequest | ||
| v3 | 2.2 | + TransactionalId stringadds the transactional ID, which is used for authorization when attempting to write transactional data. Version 3 also adds support for Kafka Message Format v2. |
| v4 | 2.2 | is the same as version 3, but the requester must be prepared to handle a KAFKA_STORAGE_ERROR. |
| v5 | 2.2 | are the same as version 3. |
| v6 | 2.2 | are the same as version 3. |
| v7 | 2.2 | records can be produced using ZStandard compression. See KIP-110. |
| v8 | 2.4 | response has RecordErrors and ErrorMessage. See KIP-467. |
| v9 | 2.8 | ~ Flexible encoding enabled FLEXIBLE enables flexible versions. |
| v10 | 3.7 | is the same as version 9 (KIP-951). |
| v11 | 3.8 | adds support for new error code TRANSACTION_ABORTABLE (KIP-890). |
| v12 | 4.0 | is the same as version 11 (KIP-890). Note when produce requests are used in transaction, if transaction V2 (KIP_890 part 2) is enabled, the produce request will also include the function for a AddPartitionsToTxn call. If V2 is disabled, the client can't use produce request version higher than 11 within a transaction. |
| v13 | 4.1 | + TopicId uuid- Name stringreplaces topic names with topic IDs (KIP-516). May return UNKNOWN_TOPIC_ID error code. |
| ProduceResponse | ||
| v3 | 2.2 | is the same as version 2. |
| v4 | 2.2 | added KAFKA_STORAGE_ERROR as a possible error code. |
| v5 | 2.2 | + LogStartOffset int64added LogStartOffset to filter out spurious OutOfOrderSequenceExceptions on the client. |
| v6 | 2.2 | No changes |
| v7 | 2.2 | No changes |
| v8 | 2.4 | + RecordErrors []BatchIndexAndErrorMessage+ BatchIndex int32+ BatchIndexErrorMessage string+ ErrorMessage stringadded RecordErrors and ErrorMessage to include information about records that cause the whole batch to be dropped. See KIP-467 for details. |
| v9 | 2.8 | ~ Flexible encoding enabled FLEXIBLE enables flexible versions. |
| v10 | 3.7 | + CurrentLeader LeaderIdAndEpoch+ LeaderId int32+ LeaderEpoch int32+ NodeEndpoints []NodeEndpoint+ NodeId int32+ Host string+ Port int32+ Rack stringadds 'CurrentLeader' and 'NodeEndpoints' as tagged fields (KIP-951) |
| v11 | 3.8 | adds support for new error code TRANSACTION_ABORTABLE (KIP-890). |
| v12 | 4.0 | is the same as version 10 (KIP-890). |
| v13 | 4.1 | + TopicId uuid- Name stringreplaces topic names with topic IDs (KIP-516). May return UNKNOWN_TOPIC_ID error code. |