kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: KAFKA-5599; ConsoleConsumer: deprecate --new-consumer option
Date Fri, 04 Aug 2017 11:41:16 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 62f03ba2c -> 5766f212d


KAFKA-5599; ConsoleConsumer: deprecate --new-consumer option

Marked --new-consumer as deprecated in the help of ConsoleConsumer
and a warning will be printed if it's used.

Author: Paolo Patierno <ppatierno@live.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #3537 from ppatierno/kafka-5599


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

Branch: refs/heads/trunk
Commit: 5766f212db961470f30125a813c1edcc1fe75f6c
Parents: 62f03ba
Author: Paolo Patierno <ppatierno@live.com>
Authored: Fri Aug 4 12:37:57 2017 +0100
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Fri Aug 4 12:41:07 2017 +0100

----------------------------------------------------------------------
 core/src/main/scala/kafka/tools/ConsoleConsumer.scala | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/5766f212/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 fd76387..f86b28b 100755
--- a/core/src/main/scala/kafka/tools/ConsoleConsumer.scala
+++ b/core/src/main/scala/kafka/tools/ConsoleConsumer.scala
@@ -269,7 +269,8 @@ object ConsoleConsumer extends Logging {
       .withRequiredArg
       .describedAs("metrics directory")
       .ofType(classOf[java.lang.String])
-    val newConsumerOpt = parser.accepts("new-consumer", "Use the new consumer implementation.
This is the default.")
+    val newConsumerOpt = parser.accepts("new-consumer", "Use the new consumer implementation.
This is the default, so " +
+      "this option is deprecated and will be removed in a future release.")
     val bootstrapServerOpt = parser.accepts("bootstrap-server", "REQUIRED (unless old consumer
is used): The server to connect to.")
       .withRequiredArg
       .describedAs("server to connect to")
@@ -386,9 +387,15 @@ object ConsoleConsumer extends Logging {
       else if (fromBeginning) OffsetRequest.EarliestTime
       else OffsetRequest.LatestTime
 
-    if (!useOldConsumer)
+    if (!useOldConsumer) {
       CommandLineUtils.checkRequiredArgs(parser, options, bootstrapServerOpt)
 
+      if (options.has(newConsumerOpt)) {
+        Console.err.println("The --new-consumer option is deprecated and will be removed
in a future major release." +
+          "The new consumer is used by default if the --bootstrap-server option is provided.")
+      }
+    }
+
     if (options.has(csvMetricsReporterEnabledOpt)) {
       val csvReporterProps = new Properties()
       csvReporterProps.put("kafka.metrics.polling.interval.secs", "5")


Mime
View raw message