private SimpleConsumer getZkConsumer(int brokerId) {
try {
Option<String> data = zkUtils.readDataMaybeNull(ZkUtils.BrokerIdsPath() + "/" + brokerId)._1;
Map<String, Object> brokerInfo = (Map<String, Object>) JSON.parseFull(data.get()).get();
String host = (String) brokerInfo.get("host");
int port = (int) brokerInfo.get("port");
return new SimpleConsumer(host, port, 10000, 100000, "ConsumerGroupCommand");
} catch (Exception ex) {
System.out.println("Could not parse broker info due to " + ex.getMessage());
return null;
}
}