A metadata request gives a Kafka client the cluster information needed to connect to the right broker. Before producing or consuming messages, the client must discover topics, partitions, brokers, and the leader responsible for each partition. section 7.4 section 9.1
The client begins with a bootstrap server, sends a metadata request for its topics, and receives broker and partition-leader information. It then connects directly to the relevant leaders to fetch or produce messages. If leadership changes after a broker failure, the client can issue another metadata request and discover the new leaders. section 7.4 section 7.5
Listing topics through a bootstrap server
A simple test setup can query one broker with: $ kafka-topics.sh --list --bootstrap-server localhost:9092. Any broker can provide the initial metadata, but relying on one address alone creates a startup dependency: clients may fail to start if that broker is unavailable. section 7.4
Using multiple bootstrap servers
A more resilient configuration lists several brokers: $ kafka-topics.sh --list --bootstrap-server localhost:9092,localhost:9093,localhost:9094. As clusters grow, a load balancer or DNS can distribute the initial metadata request, while each broker still needs a reachable address for later connections. section 7.4

