conduktor.io ↗

Kafka Metadata Request Wire Format v5 — Binary Protocol Layout

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.

Related Errors

LEADER_NOT_AVAILABLE · TOPIC_AUTHORIZATION_FAILED · UNKNOWN_TOPIC_ID

Wire Diagram

Request Header
message_size int32 · 4B
api_key int16 · 2B
api_version int16 · 2B
correlation_id int32 · 4B
client_id string
MetadataRequest v5
Topics? array
AllowAutoTopicCreation bool · 1B
Name string

Schema & Example

Schema
{
  "Topics": [{
      "Name": string
  }]?,
  "AllowAutoTopicCreation": bool
}
Example
{
  "Topics": [{
      "Name": "orders"
  }]?,
  "AllowAutoTopicCreation": true
}