【问题标题】:kafka consumer command line tool not working as expectedkafka 消费者命令行工具未按预期工作
【发布时间】:2020-12-06 16:58:17
【问题描述】:

我正在使用 Kafka 命令行工具来使用来自 Kafka 主题的数据,但这并没有按预期工作。 我正在使用以下命令:

kafka-console-consumer.sh --bootstrap-server totkafka-console-consumer.sh --bootstrap-server localhost1:9092,localhost2:9092, localhost3:9092 --topic topic-name

我收到以下错误堆栈:

Exception in thread "main" joptsimple.MultipleArgumentsForOptionException: Found multiple arguments for option bootstrap-server, but you asked for only one
    at joptsimple.OptionSet.valueOf(OptionSet.java:179)
    at kafka.tools.ConsoleConsumer$ConsumerConfig.<init>(ConsoleConsumer.scala:301)
    at kafka.tools.ConsoleConsumer$.main(ConsoleConsumer.scala:52)
    at kafka.tools.ConsoleConsumer.main(ConsoleConsumer.scala)

你能帮我解决这个问题吗?

最好的问候

【问题讨论】:

    标签: apache-kafka kafka-consumer-api


    【解决方案1】:

    您的命令中有语法错误,请尝试以下操作:

    kafka-console-consumer.sh --bootstrap-server localhost1:9092,localhost2:9092,localhost3:9092 --topic topic-name
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-09-29
      • 1970-01-01
      • 2015-06-24
      • 1970-01-01
      • 2020-01-24
      • 2015-01-26
      • 2018-09-16
      • 2021-11-25
      相关资源
      最近更新 更多