conduktor.io ↗

Kafka AddPartitionsToTxn Response Wire Format v5 — Binary Protocol Layout

What is AddPartitionsToTxn?

Transactional producers send this before writing to any new partition within a transaction to register it with the coordinator. CONCURRENT_TRANSACTIONS means another producer with the same transactional.id is still active and must complete or time out first.

Related Errors

CONCURRENT_TRANSACTIONS · COORDINATOR_NOT_AVAILABLE · INVALID_PRODUCER_EPOCH · INVALID_PRODUCER_ID_MAPPING · INVALID_REQUEST · INVALID_TRANSACTION_TIMEOUT · INVALID_TXN_STATE · NOT_COORDINATOR · OPERATION_NOT_ATTEMPTED · PRODUCER_FENCED · TOPIC_AUTHORIZATION_FAILED · TRANSACTIONAL_ID_AUTHORIZATION_FAILED · TRANSACTIONAL_ID_NOT_FOUND · TRANSACTION_ABORTABLE · UNKNOWN_TOPIC_OR_PARTITION · UNSUPPORTED_VERSION

Wire Diagram

Response Header · flexible
message_size int32 · 4B
correlation_id int32 · 4B
tagged var
AddPartitionsToTxnResponse v5
ThrottleTimeMs int32 · 4B
ErrorCode int16 · 2B
ResultsByTransaction array
tagged var
TransactionalId string (compact)
TopicResults array
tagged var
Name string (compact)
ResultsByPartition array
tagged var
PartitionIndex int32 · 4B
PartitionErrorCode int16 · 2B
tagged var

Schema & Example

Schema
{
  "ThrottleTimeMs": int32,
  "ErrorCode": int16,
  "ResultsByTransaction": [{
      "TransactionalId": string,
      "TopicResults": [{
          "Name": string,
          "ResultsByPartition": [{
              "PartitionIndex": int32,
              "PartitionErrorCode": int16
          }]
      }],
      "Name": string,
      "ResultsByPartition": [{
          "PartitionIndex": int32,
          "PartitionErrorCode": int16
      }]
  }]
}
Example
{
  "ThrottleTimeMs": 0,
  "ErrorCode": 0,
  "ResultsByTransaction": [{
      "TransactionalId": "tx-orders-001",
      "TopicResults": [{
          "Name": "orders",
          "ResultsByPartition": [{
              "PartitionIndex": 3,
              "PartitionErrorCode": 1
          }]
      }],
      "Name": "orders",
      "ResultsByPartition": [{
          "PartitionIndex": 3,
          "PartitionErrorCode": 1
      }]
  }]
}