kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject kafka git commit: kafka-2088; kafka-console-consumer.sh should not create zookeeper path when no brokers found and chroot was set in zookeeper.connect; patched by Zhiqiang He; reviewed by Gwen Shapira and Jun Rao
Date Sat, 18 Apr 2015 15:49:08 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 813c4230d -> 35297a85e


kafka-2088; kafka-console-consumer.sh should not create zookeeper path when no brokers found
and chroot was set in zookeeper.connect; patched by Zhiqiang He; reviewed by Gwen Shapira
and Jun Rao


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/35297a85
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/35297a85
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/35297a85

Branch: refs/heads/trunk
Commit: 35297a85ee4a0d9af8a3277b5ea79ed7c67496c2
Parents: 813c423
Author: Zhiqiang He <ransom.hezhiqiang@huawei.com>
Authored: Sat Apr 18 08:49:01 2015 -0700
Committer: Jun Rao <junrao@gmail.com>
Committed: Sat Apr 18 08:49:01 2015 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/tools/ConsoleConsumer.scala | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/35297a85/core/src/main/scala/kafka/tools/ConsoleConsumer.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/tools/ConsoleConsumer.scala b/core/src/main/scala/kafka/tools/ConsoleConsumer.scala
index 9d9b781..80b2674 100755
--- a/core/src/main/scala/kafka/tools/ConsoleConsumer.scala
+++ b/core/src/main/scala/kafka/tools/ConsoleConsumer.scala
@@ -126,6 +126,11 @@ object ConsoleConsumer extends Logging {
     consumerProps.put("auto.offset.reset", if(options.has(resetBeginningOpt)) "smallest"
else "largest")
     consumerProps.put("zookeeper.connect", options.valueOf(zkConnectOpt))
 
+    if (!checkZkPathExists(options.valueOf(zkConnectOpt),"/brokers/ids")) {
+      System.err.println("No brokers found.")
+      System.exit(1)
+    }
+
     if (!options.has(deleteConsumerOffsetsOpt) && options.has(resetBeginningOpt)
&&
        checkZkPathExists(options.valueOf(zkConnectOpt),"/consumers/" + consumerProps.getProperty("group.id")+
"/offsets")) {
       System.err.println("Found previous offset information for this group "+consumerProps.getProperty("group.id")


Mime
View raw message