Skip to main content

Request cluster topology

This example shows which broker is leader and follower for which partition. Particularly useful when you run a cluster with multiple Zeebe brokers.

Prerequisites​

  1. Running Zeebe broker with endpoint localhost:26500 (default)

TopologyViewer.java​

Source on github

final Topology topology = client.newTopologyRequest().send().join();

System.out.println("Topology:");
topology
.getBrokers()
.forEach(
b -> {
System.out.println(" " + b.getAddress());
b.getPartitions()
.forEach(
p ->
System.out.println(
" " + p.getPartitionId() + " - " + p.getRole()));
});