Skip to content
m manifester.io
All Kafka APIs

ListTransactions

This page encodes the smallest legal instance of the request and the response: numeric fields are zero, strings and byte arrays are empty, every array carries exactly one sample element, and any records field holds one empty 61-byte RecordBatch v2. Version 1 is a flexible version, so every struct is terminated by a uvarint tagged-field count and strings and arrays carry compact length-plus-one prefixes. Sizes below include the leading int32 size prefix.

API key
66
Encoded at
v1
Flexible versions
0+
Headers
req v2, resp v1
Request versions
0-1
Response versions
0-1
Request size
35 bytes
Response size
30 bytes
framerpc headerrequest bodyRecordBatchRecordresponse bodytagged_fields

Request

ListTransactionsRequest v1, request header v2, 35 bytes on the wire

byte layout (35 bytes, 16 bytes per row)

0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0010
0020

object tree

ListTransactionsRequest      message v1                                [0x0000, 35B]
+-- Frame                                                              [0x0000, 4B]   length-delimited framing
|   +-- size                 int32            = 31                     [0x0000, 4B]   number of bytes that follow, patched after encoding
+-- RequestHeader            v2                                        [0x0004, 11B]  common request header
|   +-- request_api_key      int16            = 66 (ListTransactions)  [0x0004, 2B]   numeric id of the API being invoked
|   +-- request_api_version  int16            = 1                      [0x0006, 2B]   version of the API being invoked
|   +-- correlation_id       int32            = 0                      [0x0008, 4B]   echoed back by the broker in the response
|   +-- client_id            nullable_string  = "" (int16 len=0)       [0x000c, 2B]   always a non-flexible int16-prefixed string
|   +-- tagged_fields        uvarint          = 0                      [0x000e, 1B]   number of tagged fields in the header
+-- ListTransactionsRequest  struct                                    [0x000f, 20B]  message body, version 1
    +-- StateFilters         []string         = 1 element              [0x000f, 2B]   The transaction states to filter by: if empty, all transactions are returne...
    |   +-- length           uvarint          = 2 (compact, n+1)       [0x000f, 1B]   one sample element follows
    |   +-- string[0]        string           = "" (compact, len+1=1)  [0x0010, 1B]
    +-- ProducerIdFilters    []int64          = 1 element              [0x0011, 9B]   The producerIds to filter by: if empty, all transactions will be returned; ...
    |   +-- length           uvarint          = 2 (compact, n+1)       [0x0011, 1B]   one sample element follows
    |   +-- int64[0]         int64            = 0                      [0x0012, 8B]
    +-- DurationFilter       int64            = 0                      [0x001a, 8B]   Duration (in millis) to filter by: if < 0, all transactions will be returne...
    +-- tagged_fields        uvarint          = 0                      [0x0022, 1B]   number of tagged fields in this struct

kafka message schema (.json)

{
  "apiKey": 66,
  "type": "request",
  "listeners": ["broker"],
  "name": "ListTransactionsRequest",
  // Version 1: adds DurationFilter to list transactions older than specified duration
  "validVersions": "0-1",
  "flexibleVersions": "0+",
  "fields": [
    { "name": "StateFilters", "type": "[]string", "versions": "0+",
      "about": "The transaction states to filter by: if empty, all transactions are returned; if non-empty, then only transactions matching one of the filtered states will be returned."
    },
    { "name": "ProducerIdFilters", "type": "[]int64", "versions": "0+", "entityType": "producerId",
      "about": "The producerIds to filter by: if empty, all transactions will be returned; if non-empty, only transactions which match one of the filtered producerIds will be returned."
    },
    { "name": "DurationFilter", "type": "int64", "versions": "1+", "default": -1,
      "about": "Duration (in millis) to filter by: if < 0, all transactions will be returned; otherwise, only transactions running longer than this duration will be returned."
    }
  ]
}

Response

ListTransactionsResponse v1, response header v1, 30 bytes on the wire

byte layout (30 bytes, 16 bytes per row)

0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0010

object tree

ListTransactionsResponse          message v1                                   [0x0000, 30B]
+-- Frame                                                                      [0x0000, 4B]   length-delimited framing
|   +-- size                      int32               = 26                     [0x0000, 4B]   number of bytes that follow, patched after encoding
+-- ResponseHeader                v1                                           [0x0004, 5B]   common response header
|   +-- correlation_id            int32               = 0                      [0x0004, 4B]   matches the correlation_id of the request
|   +-- tagged_fields             uvarint             = 0                      [0x0008, 1B]   number of tagged fields in the header
+-- ListTransactionsResponse      struct                                       [0x0009, 21B]  message body, version 1
    +-- ThrottleTimeMs            int32               = 0                      [0x0009, 4B]   The duration in milliseconds for which the request was throttled due to a q...
    +-- ErrorCode                 int16               = 0                      [0x000d, 2B]   The error code, or 0 if there was no error.
    +-- UnknownStateFilters       []string            = 1 element              [0x000f, 2B]   Set of state filters provided in the request which were unknown to the tran...
    |   +-- length                uvarint             = 2 (compact, n+1)       [0x000f, 1B]   one sample element follows
    |   +-- string[0]             string              = "" (compact, len+1=1)  [0x0010, 1B]
    +-- TransactionStates         []TransactionState  = 1 element              [0x0011, 12B]  The current state of the transaction for the transactional id.
    |   +-- length                uvarint             = 2 (compact, n+1)       [0x0011, 1B]   one sample element follows
    |   +-- TransactionState[0]   TransactionState    = struct                 [0x0012, 11B]
    |       +-- TransactionalId   string              = "" (compact, len+1=1)  [0x0012, 1B]   The transactional id.
    |       +-- ProducerId        int64               = 0                      [0x0013, 8B]   The producer id.
    |       +-- TransactionState  string              = "" (compact, len+1=1)  [0x001b, 1B]   The current transaction state of the producer.
    |       +-- tagged_fields     uvarint             = 0                      [0x001c, 1B]   number of tagged fields in this struct
    +-- tagged_fields             uvarint             = 0                      [0x001d, 1B]   number of tagged fields in this struct

kafka message schema (.json)

{
  "apiKey": 66,
  "type": "response",
  "name": "ListTransactionsResponse",
  // Version 1 is the same as version 0 (KIP-994).
  "validVersions": "0-1",
  "flexibleVersions": "0+",
  "fields": [
      { "name": "ThrottleTimeMs", "type": "int32", "versions": "0+",
        "about": "The duration in milliseconds for which the request was throttled due to a quota violation, or zero if the request did not violate any quota." },
      { "name": "ErrorCode", "type": "int16", "versions": "0+",
        "about": "The error code, or 0 if there was no error." },
      { "name": "UnknownStateFilters", "type": "[]string", "versions": "0+",
        "about": "Set of state filters provided in the request which were unknown to the transaction coordinator." },
      { "name": "TransactionStates", "type": "[]TransactionState", "versions": "0+",
        "about": "The current state of the transaction for the transactional id.", "fields": [
        { "name": "TransactionalId", "type": "string", "versions": "0+", "entityType": "transactionalId",
          "about": "The transactional id." },
        { "name": "ProducerId", "type": "int64", "versions": "0+", "entityType": "producerId",
          "about": "The producer id." },
        { "name": "TransactionState", "type": "string", "versions": "0+",
          "about": "The current transaction state of the producer." }
    ]}
  ]
}