Browse Source

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

pull/56/head
Zhiqiang He 10 years ago committed by Jun Rao
parent
commit
35297a85ee
  1. 5
      core/src/main/scala/kafka/tools/ConsoleConsumer.scala

5
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("auto.offset.reset", if(options.has(resetBeginningOpt)) "smallest" else "largest")
consumerProps.put("zookeeper.connect", options.valueOf(zkConnectOpt)) 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) && if (!options.has(deleteConsumerOffsetsOpt) && options.has(resetBeginningOpt) &&
checkZkPathExists(options.valueOf(zkConnectOpt),"/consumers/" + consumerProps.getProperty("group.id")+ "/offsets")) { checkZkPathExists(options.valueOf(zkConnectOpt),"/consumers/" + consumerProps.getProperty("group.id")+ "/offsets")) {
System.err.println("Found previous offset information for this group "+consumerProps.getProperty("group.id") System.err.println("Found previous offset information for this group "+consumerProps.getProperty("group.id")

Loading…
Cancel
Save