Skip to main content
Version: 8.4

Request cluster topology

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

Prerequisites

Run Zeebe broker with endpoint localhost:26500 (default).

TopologyViewer.java

/tree/main/zeebe-client-plain-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()));
});