Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is difference between consuming messages from bootstrap server and zookeeper?

I am beginner to Apache kafka. I am confused between bootstrap server and zookeeper. So please explain what is bootstrap server in kafka and How it is different from zookeeper? What does it mean to consume messages from bootstrap server or zookeeper.

like image 971
Himanshu Sahu Avatar asked Dec 01 '25 17:12

Himanshu Sahu


1 Answers

You are confused because Kafka has two consumers, old and new.

You should probably use the new one, which means you only need to configure bootstrap-servers (urls of Kafka brokers you are consuming from) and no need to define zookeeper connection url.

If you use the old consumer, it requires Zookeeper to maintain its state (last message read from each partition) - so you give it a zookeeper URL (since it needs zookeeper anyway) and it uses Zookeeper to find the Kafka brokers.

like image 51
Gwen Shapira Avatar answered Dec 04 '25 06:12

Gwen Shapira



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!