node.create(false, dropConfig.toString().getBytes());
}
String broker = exchangeFarm.getCurrentExchangeHost(ex);
if(broker != null) {
BrokerAdmin brokerAdmin = new BrokerAdmin(broker);
brokerAdmin.jmxConnectServer();
try {
if(dropConfig.getPolicy().equals(ZooKeeperInfo.DropConfig.Policy.NEWEST)) {
brokerAdmin.setExchangeAttrib(ex, "LimitBehavior", "REJECT_NEWEST");
}
else {
brokerAdmin.setExchangeAttrib(ex, "LimitBehavior", "REMOVE_OLDEST");
}
}
finally {
brokerAdmin.jmxCloseServer();
}
}
}