conduktor.io ↗

Kafka InitProducerId Response Wire Format v2 — Binary Protocol Layout

What is InitProducerId?

Every idempotent or transactional producer calls this before sending records to obtain a producer ID and epoch. The epoch prevents zombie producers: a restarted instance bumps the epoch, and late-arriving writes from the old instance are rejected with INVALID_PRODUCER_EPOCH.

Related Errors

CLUSTER_AUTHORIZATION_FAILED · CONCURRENT_TRANSACTIONS · COORDINATOR_LOAD_IN_PROGRESS · COORDINATOR_NOT_AVAILABLE · INVALID_PRODUCER_EPOCH · INVALID_PRODUCER_ID_MAPPING · INVALID_REGULAR_EXPRESSION · INVALID_REQUEST · INVALID_TRANSACTION_TIMEOUT · INVALID_TXN_STATE · KAFKA_STORAGE_ERROR · MESSAGE_TOO_LARGE · NOT_COORDINATOR · NOT_ENOUGH_REPLICAS · NOT_ENOUGH_REPLICAS_AFTER_APPEND · NOT_LEADER_OR_FOLLOWER · PRODUCER_FENCED · RECORD_LIST_TOO_LARGE · REQUEST_TIMED_OUT · TRANSACTIONAL_ID_AUTHORIZATION_FAILED · TRANSACTIONAL_ID_NOT_FOUND · TRANSACTION_ABORTABLE · UNKNOWN_SERVER_ERROR · UNKNOWN_TOPIC_OR_PARTITION · UNSUPPORTED_VERSION

Wire Diagram

Response Header · flexible
message_size int32 · 4B
correlation_id int32 · 4B
tagged var
InitProducerIdResponse v2
ThrottleTimeMs int32 · 4B
ErrorCode int16 · 2B
ProducerId int64 · 8B
ProducerEpoch int16 · 2B
tagged var

Schema & Example

Schema
{
  "ThrottleTimeMs": int32,
  "ErrorCode": int16,
  "ProducerId": int64,
  "ProducerEpoch": int16
}
Example
{
  "ThrottleTimeMs": 0,
  "ErrorCode": 0,
  "ProducerId": 0,
  "ProducerEpoch": 12
}