ARTEMIS-3195 Filter empty items from listNetworkTopology

This commit is contained in:
Domenico Francesco Bruscino 2021-03-22 09:06:04 +01:00 committed by Clebert Suconic
parent 31345c5b51
commit 4473758edb
1 changed files with 2 additions and 2 deletions

View File

@ -4043,16 +4043,16 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
Collection<TopologyMemberImpl> members = topology.getMembers();
for (TopologyMemberImpl member : members) {
JsonObjectBuilder obj = JsonLoader.createObjectBuilder();
TransportConfiguration live = member.getLive();
if (live != null) {
JsonObjectBuilder obj = JsonLoader.createObjectBuilder();
obj.add("nodeID", member.getNodeId()).add("live", live.getParams().get("host") + ":" + live.getParams().get("port"));
TransportConfiguration backup = member.getBackup();
if (backup != null) {
obj.add("backup", backup.getParams().get("host") + ":" + backup.getParams().get("port"));
}
brokers.add(obj);
}
brokers.add(obj);
}
}
}