I have read thread boostrap-server vs zookeeper in consumer console but that's not clear my doubt.
My doubt is, let say we have zookeeper running at localhost:2181, three broker servers are running at localhost:9092, localhost:9093, localhost:9094 and we have one topic my_topic with partition 3 and replication 1 and topic is shared by brokers because it has three partitions.
In new version of Apache-Kafka when we are running consumer console so we need to pass --bootstrap-server localhost:9092
which is one of
broker address but in earlier version we are passing zookeeper address.
So when we are running consumer to consume message from the topic my_topic
, we are passing parameter --bootstrap-server localhost:9092
which is nothing but one of the broker address, So my question is, are we restricting consumer that you have to consume messages only from that broker and if it is than let say if that broker is down itself, so how consumer will read the messages from that topic. I didn't understand how is it working, may someone please clear it.
Older Version command for run consumer(< 1.0)bin/kafka-console-consumer.sh --zookeeper localhost:2181 --from- beginning --topic my_topic
Newer version command for run consumer( >= 1.0) bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --from-beginning --topic my_topic