Reputation: 21
for consumer
bin/windows/kafka-console-consumer.bat --bootstrap-server localhost:9092 --top
irer
and for producer
bin/windows/kafka-console-producer.bat --broker-list localhost:9092 --topic test
because I think for producer, we can also only choose one broker, from this broker server, we can find the all the partition information and find the leader, so I don't think broker-list is really needed.
Upvotes: 1
Views: 365
Reputation: 26885
This is for historical reasons, in either case, the provided brokers are only used to bootstrap and discover the full cluster.
Before Kafka 0.9, the consumer was still using Zookeeper to bootstrap. At that time, the producer was already using --broker-list
.
In 0.9, when the "new" consumer was added, the flag to specify the broker was named --bootstrap-server
for good reason as it is exactly what it is. Since then, the tools have used different flag name even though they are the same thing.
This was annoying and finally in 2.5.0, released just a few weeks ago, all tools have been updated to use --bootstrap-server
!
Upvotes: 3