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.
Wire Diagram
Request Header
message_size
int32 · 4B
api_key
int16 · 2B
api_version
int16 · 2B
correlation_id
int32 · 4B
client_id
string
AddOffsetsToTxnRequest v1
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" }