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.
Wire Diagram
Request Header v2 · flexible
message_size
int32 · 4B
api_key
int16 · 2B
api_version
int16 · 2B
correlation_id
int32 · 4B
client_id?
nullable string · int16 length
tagged
var
BrokerRegistrationRequest v3
BrokerId
int32 · 4B
ClusterId
string (compact)
IncarnationId
uuid · 16B
Rack?
string (compact)
IsMigratingZkBroker
bool · 1B
LogDirs
[]uuid
PreviousBrokerEpoch
int64 · 8B
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 }
Illustrative values (not encoded bytes) { "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-a716-446655440000", "6ba7b810-9dad-11d1-80b4-00c04fd430c8"], "PreviousBrokerEpoch": 12 }