Repository: kafka
Updated Branches:
  refs/heads/trunk 002612154 -> ad71b9d06


MINOR: Avoiding attempt to connect to Zookeeper on closing consumer for 
deleting random group.id with the new one

With the new consumer the "/consumers" path on Zookeeper isn't filled by 
consumer info. On closing the new consumer, there is some code that is useless 
to execute for trying to connect to Zookeeper (but the URL is null).

Author: ppatierno <[email protected]>
Author: Paolo Patierno <[email protected]>

Reviewers: Ismael Juma <[email protected]>

Closes #3301 from ppatierno/old-consumer-delete-groupid


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

Branch: refs/heads/trunk
Commit: ad71b9d068f63b2e64bcce72c557115efd2cc1ca
Parents: 0026121
Author: ppatierno <[email protected]>
Authored: Fri Nov 17 12:20:33 2017 +0000
Committer: Ismael Juma <[email protected]>
Committed: Fri Nov 17 12:20:33 2017 +0000

----------------------------------------------------------------------
 core/src/main/scala/kafka/tools/ConsoleConsumer.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/ad71b9d0/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 8b20601..02690f1 100755
--- a/core/src/main/scala/kafka/tools/ConsoleConsumer.scala
+++ b/core/src/main/scala/kafka/tools/ConsoleConsumer.scala
@@ -88,7 +88,7 @@ object ConsoleConsumer extends Logging {
       reportRecordCount()
 
       // if we generated a random group id (as none specified explicitly) then 
avoid polluting zookeeper with persistent group data, this is a hack
-      if (!conf.groupIdPassed)
+      if (conf.useOldConsumer && !conf.groupIdPassed)
         ZkUtils.maybeDeletePath(conf.options.valueOf(conf.zkConnectOpt), 
"/consumers/" + conf.consumerProps.get("group.id"))
 
       shutdownLatch.countDown()

Reply via email to