diff --git a/src/main/groovy/com/github/lookout/verspaetung/zk/BrokerTreeWatcher.groovy b/src/main/groovy/com/github/lookout/verspaetung/zk/BrokerTreeWatcher.groovy index 32fa290..477aad9 100644 --- a/src/main/groovy/com/github/lookout/verspaetung/zk/BrokerTreeWatcher.groovy +++ b/src/main/groovy/com/github/lookout/verspaetung/zk/BrokerTreeWatcher.groovy @@ -68,9 +68,15 @@ class BrokerTreeWatcher implements TreeCacheListener { } ChildData nodeData = event.data + Integer brokerId = brokerIdFromPath(nodeData.path) + + if (brokerId == INVALID_BROKER_ID) { + return + } + Object brokerData = json.parseText(new String(nodeData.data, 'UTF-8')) - this.brokers << new KafkaBroker(brokerData, brokerIdFromPath(nodeData.path)) + this.brokers << new KafkaBroker(brokerData, brokerId) } /**