BrokerHeartbeat
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
- 63
- Encoded at
- v1
- Flexible versions
- 0+
- Headers
- req v2, resp v1
- Request versions
- 0-1
- Response versions
- 0-1
- Request size
- 38 bytes
- Response size
- 19 bytes
framerpc headerrequest bodyRecordBatchRecordresponse bodytagged_fields
Request
BrokerHeartbeatRequest v1, request header v2, 38 bytes on the wire
byte layout (38 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
BrokerHeartbeatRequest message v1 [0x0000, 38B] +-- Frame [0x0000, 4B] length-delimited framing | +-- size int32 = 34 [0x0000, 4B] number of bytes that follow, patched after encoding +-- RequestHeader v2 [0x0004, 11B] common request header | +-- request_api_key int16 = 63 (BrokerHeartbeat) [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 +-- BrokerHeartbeatRequest struct [0x000f, 23B] message body, version 1 +-- BrokerId int32 = 0 [0x000f, 4B] The broker ID. +-- BrokerEpoch int64 = 0 [0x0013, 8B] The broker epoch. +-- CurrentMetadataOffset int64 = 0 [0x001b, 8B] The highest metadata offset which the broker has reached. +-- WantFence bool = false [0x0023, 1B] True if the broker wants to be fenced, false otherwise. +-- WantShutDown bool = false [0x0024, 1B] True if the broker wants to be shut down, false otherwise. +-- tagged_fields uvarint = 0 [0x0025, 1B] number of tagged fields in this struct
kafka message schema (.json)
{ "apiKey": 63, "type": "request", "listeners": ["controller"], "name": "BrokerHeartbeatRequest", "validVersions": "0-1", "flexibleVersions": "0+", "fields": [ { "name": "BrokerId", "type": "int32", "versions": "0+", "entityType": "brokerId", "about": "The broker ID." }, { "name": "BrokerEpoch", "type": "int64", "versions": "0+", "default": "-1", "about": "The broker epoch." }, { "name": "CurrentMetadataOffset", "type": "int64", "versions": "0+", "about": "The highest metadata offset which the broker has reached." }, { "name": "WantFence", "type": "bool", "versions": "0+", "about": "True if the broker wants to be fenced, false otherwise." }, { "name": "WantShutDown", "type": "bool", "versions": "0+", "about": "True if the broker wants to be shut down, false otherwise." }, { "name": "OfflineLogDirs", "type": "[]uuid", "versions": "1+", "taggedVersions": "1+", "tag": "0", "about": "Log directories that failed and went offline." } ] }
Response
BrokerHeartbeatResponse v1, response header v1, 19 bytes on the wire
byte layout (19 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
BrokerHeartbeatResponse message v1 [0x0000, 19B] +-- Frame [0x0000, 4B] length-delimited framing | +-- size int32 = 15 [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 +-- BrokerHeartbeatResponse struct [0x0009, 10B] message body, version 1 +-- 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. +-- IsCaughtUp bool = false [0x000f, 1B] True if the broker has approximately caught up with the latest metadata. +-- IsFenced bool = false [0x0010, 1B] True if the broker is fenced. +-- ShouldShutDown bool = false [0x0011, 1B] True if the broker should proceed with its shutdown. +-- tagged_fields uvarint = 0 [0x0012, 1B] number of tagged fields in this struct
kafka message schema (.json)
{ "apiKey": 63, "type": "response", "name": "BrokerHeartbeatResponse", "validVersions": "0-1", "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": "IsCaughtUp", "type": "bool", "versions": "0+", "default": "false", "about": "True if the broker has approximately caught up with the latest metadata." }, { "name": "IsFenced", "type": "bool", "versions": "0+", "default": "true", "about": "True if the broker is fenced." }, { "name": "ShouldShutDown", "type": "bool", "versions": "0+", "about": "True if the broker should proceed with its shutdown." } ] }