[ https://issues.apache.org/jira/browse/KAFKA-8507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16884693#comment-16884693 ]
Lee Dongjin commented on KAFKA-8507: ------------------------------------ [~hachikuji] [~ijuma] I researched this issue last weekend (following KAFKA-8610) and found it is a little bit more complicated than expected. As of present, the command-line tools are located in kafka.tools package or kafka.admin package in the core module, with jOptSimple as a arguments parser. By this way, the tools provide a standardized interface like 'version' parameter. However, there are some inconsistencies: 1. The following tools are located in org.apache.kafka.tools package the tools module, which holds integration test tools: 1. ProducerPerformance 2. VerifiableProducer 3. VerifiableConsumer Above tools are also using argparse4j as a parser. As a result, they do not provide standardized 'version' parameter. (see KAFKA-8292) They are also using 'producer-props' or 'broker-list', not 'bootstrap-server'. 2. The following tools are not using 'bootstrap-server'. Asterisk means there is a PR about this issue. 1. GetOffsetShell: using 'broker-list' 2. ReplicaVerificationTool: using 'broker-list' 3. ConsumerPerformance: using 'broker-list' 4. ConsoleProducer: using 'broker-list' 5. StreamResetter: using 'bootstrap-servers' [*] 6. VerifiableLog4jAppender: using 'broker-list' 7. TransactionalMessageCopier: using 'broker-list' 8. ReassignPartitionsCommand: using 'broker-list' [*] 9. LogDirsCommand: using 'broker-list' 3. There are some other problems: 1. ProducerPerformance provides producer-props, but ConsumerPerformance doesn't have consumer-props. (see KAFKA-8647) Since jOptSimple does not support arguments like '--producer-props acks=1 bootstrap.servers=localhost:9092 buffer.memory=67108864', producer-props should be deprecated and removed - not adding consumer-props. 2. ConfigCommand supports both of Zookeeper-based processing and broker-based processing (with zookeeper, bootstrap-server parameters) but 'zookeeper' is a required parameter now; The user must specify either of 'zookeeper' or 'bootstrap-server' only. 3. jOptSimple API is not used properly. For example, jOptSimple provides a way to specify required parameters ([ArgumentAcceptingOptionSpec#required|http://jopt-simple.github.io/jopt-simple/apidocs/joptsimple/ArgumentAcceptingOptionSpec.html#required--]) which throws exception on parsing. But currently, CommandLineUtils#checkRequiredArgs is used instead. 4. Trivial: in scala, it is recommended to call a method without arguments without parenthesis. However, there are several withRequiredArg() or withOptionalArg(). IMHO, how about this approach? A. Create an umbrella issue with the described above, which handles all command-line tools inconsistencies. (Of course, it requires a KIP.) B. Make the issues above into the subtask of the umbrella issue. If it is okay, I hope to take this task. Note: You can check [the draft implementation|https://github.com/dongjinleekr/kafka/tree/feature/KAFKA-8292] which handles package and parsing inconsistency described in 1. [#1|https://github.com/dongjinleekr/kafka/blob/feature%2FKAFKA-8292/core/src/main/scala/kafka/tools/ProducerPerformance.scala] [#2|https://github.com/dongjinleekr/kafka/blob/feature%2FKAFKA-8292/core/src/test/scala/kafka/tools/ProducerPerformanceTest.scala] Note 2: Keeping 'ProducerConfig.BOOTSTRAP_SERVERS_CONFIG' in mind, 'bootstrap-servers' may be better for consistency. How do you think? > Support --bootstrap-server in all command line tools > ---------------------------------------------------- > > Key: KAFKA-8507 > URL: https://issues.apache.org/jira/browse/KAFKA-8507 > Project: Kafka > Issue Type: Improvement > Components: tools > Reporter: Jason Gustafson > Priority: Major > Labels: needs-kip > > This is a unambitious initial move toward standardizing the command line > tools. We have favored the name {{\-\-bootstrap-server}} in all new tools > since it matches the config {{bootstrap.server}} which is used by all > clients. Some older commands use {{\-\-broker-list}} or > {{\-\-bootstrap-servers}} and maybe other exotic variations. We should > support {{\-\-bootstrap-server}} in all commands and deprecate the other > options. -- This message was sent by Atlassian JIRA (v7.6.14#76016)