diff --git a/src/main/java/org/zalando/nakadi/repository/zookeeper/ZooKeeperHolder.java b/src/main/java/org/zalando/nakadi/repository/zookeeper/ZooKeeperHolder.java index 68c39bea18..4aaa229a8d 100644 --- a/src/main/java/org/zalando/nakadi/repository/zookeeper/ZooKeeperHolder.java +++ b/src/main/java/org/zalando/nakadi/repository/zookeeper/ZooKeeperHolder.java @@ -31,7 +31,6 @@ public class ZooKeeperHolder { private final Integer exhibitorPort; private final Integer sessionTimeoutMs; private final Integer connectionTimeoutMs; - private final String connectionString; private CuratorFramework zooKeeper; @@ -47,8 +46,6 @@ public ZooKeeperHolder(final String zookeeperBrokers, this.exhibitorPort = exhibitorPort; this.sessionTimeoutMs = sessionTimeoutMs; this.connectionTimeoutMs = connectionTimeoutMs; - this.connectionString = - (exhibitorAddresses == null ? zookeeperBrokers : exhibitorAddresses) + zookeeperKafkaNamespace; initExhibitor(); } @@ -83,8 +80,10 @@ public CuratorFramework get() { public Closeable newZookeeperLock(final String lockObject, final long timeoutMs) throws RuntimeException { try { - final ZookeeperLock zookeeperLock = new ZookeeperLock(new ZooKeeper(connectionString, - sessionTimeoutMs, new NakadiZookeeperWatcher())); + final ZookeeperLock zookeeperLock = new ZookeeperLock(new ZooKeeper( + zooKeeper.getZookeeperClient().getCurrentConnectionString(), + sessionTimeoutMs, + new NakadiZookeeperWatcher())); return zookeeperLock.tryLock(lockObject, timeoutMs); } catch (final Exception e) { throw new RuntimeException("Failed to get zookeeper client", e); @@ -96,7 +95,7 @@ private static class NakadiZookeeperWatcher implements Watcher { @Override public void process(final WatchedEvent event) { - LOG.info("{}", event); + LOG.debug("{}", event); } }