} catch (ConfigurationException e) {
throw new IOException(e);
}
}
ClientConfiguration hubClientCfg = new ClientConfiguration();
String clientCfgFile = cl.getOption("client-cfg");
if (clientCfgFile != null) {
try {
hubClientCfg.loadConf(new File(clientCfgFile).toURI().toURL());
} catch (ConfigurationException e) {
throw new IOException(e);
}
}
printMessage("Connecting to zookeeper/bookkeeper using HedwigAdmin");
try {
admin = new HedwigAdmin(bkClientConf, hubServerConf);
admin.getZkHandle().register(new MyWatcher());
} catch (Exception e) {
throw new IOException(e);
}
printMessage("Connecting to default hub server " + hubClientCfg.getDefaultServerHost());
hubClient = new HedwigClient(hubClientCfg);
publisher = hubClient.getPublisher();
subscriber = hubClient.getSubscriber();
subscriber.addSubscriptionListener(new ConsoleSubscriptionListener());