BrokerRegistration
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 4 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
- 62
- Encoded at
- v4
- Flexible versions
- 0+
- Headers
- req v2, resp v1
- Request versions
- 0-4
- Response versions
- 0-4
- Request size
- 79 bytes
- Response size
- 24 bytes
framerpc headerrequest bodyRecordBatchRecordresponse bodytagged_fields
Request
BrokerRegistrationRequest v4, request header v2, 79 bytes on the wire
byte layout (79 bytes, 16 bytes per row)
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
0000
0010
0020
0030
0040
object tree
BrokerRegistrationRequest message v4 [0x0000, 79B] +-- Frame [0x0000, 4B] length-delimited framing | +-- size int32 = 75 [0x0000, 4B] number of bytes that follow, patched after encoding +-- RequestHeader v2 [0x0004, 11B] common request header | +-- request_api_key int16 = 62 (BrokerRegistration) [0x0004, 2B] numeric id of the API being invoked | +-- request_api_version int16 = 4 [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 +-- BrokerRegistrationRequest struct [0x000f, 64B] message body, version 4 +-- BrokerId int32 = 0 [0x000f, 4B] The broker ID. +-- ClusterId string = "" (compact, len+1=1) [0x0013, 1B] The cluster id of the broker process. +-- IncarnationId uuid = 00000000-0000-0000-0000-000000000000 [0x0014, 16B] The incarnation id of the broker process. +-- Listeners []Listener = 1 element [0x0024, 8B] The listeners of this broker. | +-- length uvarint = 2 (compact, n+1) [0x0024, 1B] one sample element follows | +-- Listener[0] Listener = struct [0x0025, 7B] | +-- Name string = "" (compact, len+1=1) [0x0025, 1B] The name of the endpoint. | +-- Host string = "" (compact, len+1=1) [0x0026, 1B] The hostname. | +-- Port uint16 = 0 [0x0027, 2B] The port. | +-- SecurityProtocol int16 = 0 [0x0029, 2B] The security protocol. | +-- tagged_fields uvarint = 0 [0x002b, 1B] number of tagged fields in this struct +-- Features []Feature = 1 element [0x002c, 7B] The features on this broker. Note: in v0-v3, features with MinSupportedVers... | +-- length uvarint = 2 (compact, n+1) [0x002c, 1B] one sample element follows | +-- Feature[0] Feature = struct [0x002d, 6B] | +-- Name string = "" (compact, len+1=1) [0x002d, 1B] The feature name. | +-- MinSupportedVersion int16 = 0 [0x002e, 2B] The minimum supported feature level. | +-- MaxSupportedVersion int16 = 0 [0x0030, 2B] The maximum supported feature level. | +-- tagged_fields uvarint = 0 [0x0032, 1B] number of tagged fields in this struct +-- Rack string = "" (compact, len+1=1) [0x0033, 1B] The rack which this broker is in. +-- IsMigratingZkBroker bool = false [0x0034, 1B] If the required configurations for ZK migration are present, this value is ... +-- LogDirs []uuid = 1 element [0x0035, 17B] Log directories configured in this broker which are available. | +-- length uvarint = 2 (compact, n+1) [0x0035, 1B] one sample element follows | +-- uuid[0] uuid = 00000000-0000-0000-0000-000000000000 [0x0036, 16B] +-- PreviousBrokerEpoch int64 = 0 [0x0046, 8B] The epoch before a clean shutdown. +-- tagged_fields uvarint = 0 [0x004e, 1B] number of tagged fields in this struct
kafka message schema (.json)
{ "apiKey":62, "type": "request", "listeners": ["controller"], "name": "BrokerRegistrationRequest", "validVersions": "0-4", "flexibleVersions": "0+", "fields": [ { "name": "BrokerId", "type": "int32", "versions": "0+", "entityType": "brokerId", "about": "The broker ID." }, { "name": "ClusterId", "type": "string", "versions": "0+", "about": "The cluster id of the broker process." }, { "name": "IncarnationId", "type": "uuid", "versions": "0+", "about": "The incarnation id of the broker process." }, { "name": "Listeners", "type": "[]Listener", "about": "The listeners of this broker.", "versions": "0+", "fields": [ { "name": "Name", "type": "string", "versions": "0+", "mapKey": true, "about": "The name of the endpoint." }, { "name": "Host", "type": "string", "versions": "0+", "about": "The hostname." }, { "name": "Port", "type": "uint16", "versions": "0+", "about": "The port." }, { "name": "SecurityProtocol", "type": "int16", "versions": "0+", "about": "The security protocol." } ] }, { "name": "Features", "type": "[]Feature", "about": "The features on this broker. Note: in v0-v3, features with MinSupportedVersion = 0 are omitted.", "versions": "0+", "fields": [ { "name": "Name", "type": "string", "versions": "0+", "mapKey": true, "about": "The feature name." }, { "name": "MinSupportedVersion", "type": "int16", "versions": "0+", "about": "The minimum supported feature level." }, { "name": "MaxSupportedVersion", "type": "int16", "versions": "0+", "about": "The maximum supported feature level." } ] }, { "name": "Rack", "type": "string", "versions": "0+", "nullableVersions": "0+", "about": "The rack which this broker is in." }, { "name": "IsMigratingZkBroker", "type": "bool", "versions": "1+", "default": "false", "about": "If the required configurations for ZK migration are present, this value is set to true." }, { "name": "LogDirs", "type": "[]uuid", "versions": "2+", "about": "Log directories configured in this broker which are available.", "ignorable": true }, { "name": "PreviousBrokerEpoch", "type": "int64", "versions": "3+", "default": "-1", "ignorable": true, "about": "The epoch before a clean shutdown." } ] }
Response
BrokerRegistrationResponse v4, response header v1, 24 bytes on the wire
byte layout (24 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
BrokerRegistrationResponse message v4 [0x0000, 24B] +-- Frame [0x0000, 4B] length-delimited framing | +-- size int32 = 20 [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 +-- BrokerRegistrationResponse struct [0x0009, 15B] message body, version 4 +-- ThrottleTimeMs int32 = 0 [0x0009, 4B] Duration in milliseconds for which the request was throttled due to a quota... +-- ErrorCode int16 = 0 [0x000d, 2B] The error code, or 0 if there was no error. +-- BrokerEpoch int64 = 0 [0x000f, 8B] The broker's assigned epoch, or -1 if none was assigned. +-- tagged_fields uvarint = 0 [0x0017, 1B] number of tagged fields in this struct
kafka message schema (.json)
{ "apiKey": 62, "type": "response", "name": "BrokerRegistrationResponse", "validVersions": "0-4", "flexibleVersions": "0+", "fields": [ { "name": "ThrottleTimeMs", "type": "int32", "versions": "0+", "about": "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": "BrokerEpoch", "type": "int64", "versions": "0+", "default": "-1", "about": "The broker's assigned epoch, or -1 if none was assigned." } ] }