public void close() throws IOException { synchronized (lock) { if (zkClient == null) { logger.info("cannot shutdown already shutdown topic event watcher "); return; } stopWatchingTopicEvents(); zkClient.close(); zkClient = null; } }