conduktor.io ↗

Kafka AddOffsetsToTxn Request Wire Format v2 — Binary Protocol Layout

What is AddOffsetsToTxn?

Enrolls an offset commit in the current transaction for exactly-once consume-transform-produce. If the transaction aborts, both the produced records and the offset commit are rolled back atomically.

Related Errors

CONCURRENT_TRANSACTIONS · COORDINATOR_NOT_AVAILABLE · GROUP_AUTHORIZATION_FAILED · INVALID_PRODUCER_EPOCH · INVALID_PRODUCER_ID_MAPPING · INVALID_REQUEST · INVALID_TRANSACTION_TIMEOUT · INVALID_TXN_STATE · NOT_COORDINATOR · PRODUCER_FENCED · TRANSACTIONAL_ID_AUTHORIZATION_FAILED · TRANSACTIONAL_ID_NOT_FOUND · TRANSACTION_ABORTABLE · UNSUPPORTED_VERSION

Wire Diagram

Request Header
message_size int32 · 4B
api_key int16 · 2B
api_version int16 · 2B
correlation_id int32 · 4B
client_id string
AddOffsetsToTxnRequest v2
TransactionalId string
ProducerId int64 · 8B
ProducerEpoch int16 · 2B
GroupId string

Schema & Example

Schema
{
  "TransactionalId": string,
  "ProducerId": int64,
  "ProducerEpoch": int16,
  "GroupId": string
}
Example
{
  "TransactionalId": "tx-orders-001",
  "ProducerId": 0,
  "ProducerEpoch": 12,
  "GroupId": "order-processors"
}