Bird
0
0

You run kafka-console-producer.sh --topic my-topic --broker-list localhost:9092 but get an error saying 'Unknown option: --broker-list'. What is the likely cause?

medium📝 Debug Q6 of 15
Kafka - Basics and Event Streaming
You run kafka-console-producer.sh --topic my-topic --broker-list localhost:9092 but get an error saying 'Unknown option: --broker-list'. What is the likely cause?
AUsing an outdated Kafka version where --broker-list is not recognized
BMisspelling the topic name
CNot specifying the bootstrap server
DRunning the command without internet connection
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the error message

    'Unknown option: --broker-list' means the CLI does not recognize this flag.
  2. Step 2: Consider Kafka version compatibility

    Older Kafka versions used --broker-list, newer versions use --bootstrap-server instead.
  3. Final Answer:

    Using an outdated Kafka version where --broker-list is not recognized -> Option A
  4. Quick Check:

    Option flags depend on Kafka version [OK]
Quick Trick: Check Kafka version for correct CLI options [OK]
Common Mistakes:
  • Assuming topic name typo causes option error
  • Confusing bootstrap-server with broker-list
  • Blaming network issues for CLI option errors

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes