What is Metadata?
The first API every client calls after connecting, and re-called on NOT_LEADER or UNKNOWN_TOPIC_OR_PARTITION errors. A surge in Metadata requests signals partition leaders are moving around, typically during rolling restarts, broker failures, or reassignments.
Wire Diagram
Request Header
message_size
int32 · 4B
api_key
int16 · 2B
api_version
int16 · 2B
correlation_id
int32 · 4B
client_id
string
MetadataRequest v4
AllowAutoTopicCreation
bool · 1B
Name
string
Schema & Example
Schema { "Topics": [{ "Name": string }]?, "AllowAutoTopicCreation": bool }
Example { "Topics": [{ "Name": "orders" }]?, "AllowAutoTopicCreation": true }