Viewing topic information

You can also use the following kcat command to view broker and topic information. Remember to replace the bootstrap server and credentials as described in previous examples.

-X security.protocol=SASL_SSL \
-X sasl.mechanisms=PLAIN \
-X sasl.username="$CLIENT_ID" \
-X sasl.password="$CLIENT_SECRET" -L

The output will resemble the following:

Metadata for all topics (from broker -1: sasl_ssl://
 3 brokers:
  broker 0 at (controller)
  broker 2 at
  broker 1 at
 1 topic:
  topic "songs" with 1 partitions:
    partition 0, leader 1, replicas: 1,0,2, isrs: 1,0,2

This output explains that the single partition of the songs topic is replicated across all three brokers, and that broker 1 is the leader of the partition. The replicas are populated by following the leader state.