conduktor.io ↗

Kafka BrokerRegistration Request Wire Format v5 — Binary Protocol Layout

What is BrokerRegistration?

A broker sends this on startup in KRaft mode to register with the active controller. The incarnation UUID changes on every restart, letting the controller distinguish a restart from a slow broker and prevent two instances of the same broker ID from both being active.

Related Errors

BROKER_ID_NOT_REGISTERED · DUPLICATE_BROKER_REGISTRATION · INVALID_REGISTRATION

Wire Diagram

Request Header · flexible
message_size int32 · 4B
api_key int16 · 2B
api_version int16 · 2B
correlation_id int32 · 4B
client_id string (compact)
tagged var
BrokerRegistrationRequest v5
BrokerId int32 · 4B
ClusterId string (compact)
IncarnationId uuid · 16B
Listeners array
Features array
Rack? string (compact)
IsMigratingZkBroker bool · 1B
LogDirs []uuid
PreviousBrokerEpoch int64 · 8B
CordonedLogDirs []uuid
tagged var
Name string (compact)
Host string (compact)
Port uint16 · 2B
SecurityProtocol int16 · 2B
tagged var
Name string (compact)
MinSupportedVersion int16 · 2B
MaxSupportedVersion int16 · 2B
tagged var

Schema & Example

Schema
{
  "BrokerId": int32,
  "ClusterId": string,
  "IncarnationId": uuid,
  "Listeners": [{
      "Name": string,
      "Host": string,
      "Port": uint16,
      "SecurityProtocol": int16
  }],
  "Features": [{
      "Name": string,
      "MinSupportedVersion": int16,
      "MaxSupportedVersion": int16
  }],
  "Rack": string?,
  "IsMigratingZkBroker": bool,
  "LogDirs": [uuid],
  "PreviousBrokerEpoch": int64,
  "CordonedLogDirs": [uuid]
}
Example
{
  "BrokerId": 1,
  "ClusterId": "dQw4w9WgXcQ",
  "IncarnationId": "550e8400-e29b-41d4-a716-446655440000",
  "Listeners": [{
      "Name": "orders",
      "Host": "broker-1.kafka.local",
      "Port": 9092,
      "SecurityProtocol": 1
  }],
  "Features": [{
      "Name": "orders",
      "MinSupportedVersion": 1,
      "MaxSupportedVersion": 1
  }],
  "Rack": "us-east-1a",
  "IsMigratingZkBroker": true,
  "LogDirs": ["550e8400-e29b-41d4-...", "6ba7b810-9dad-11d1-..."],
  "PreviousBrokerEpoch": 12,
  "CordonedLogDirs": ["550e8400-e29b-41d4-...", "6ba7b810-9dad-11d1-..."]
}