Apache Kafka Installation on Mac using Homebrew

Ankit Thakur
Aug 28, 2018 · 3 min read

Hi all,

I have started following the apache kafka documentation, but later thought to find the homebrew installer of Kafka. So to install Kafka on Mac using Homebrew:

Here are the logs:

Now start Zookeeper and Kafka:

Start Zookeeper:

Start Kafka server:

WARNING:

During server start, you might be facing connection broken issue.

To fix this issue, we need to change the server.properties file.

Here uncomment the server settings and update the value from

to

and restart the server and it will work great.

Create Kafka Topic:

A topic is a category or feed name to which records are published. Topics in Kafka are always multi-subscriber; that is, a topic can have zero, one, or many consumers that subscribe to the data written to it.

Here we have created a topic name test

Initialize Producer console:

Now we will initialize the Kafka producer console, which will listen to localhost at port 9092 at topic test :

Initialize Consumer console:

Now we will initialize the Kafka consumer console, which will listen to bootstrap server localhost at port 9092 at topic test from beginning:

Congratulations everyone, hopefully it is helpful.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade