$ brew update
$ brew cask install java
$ brew install kafka
$ zookeeper-server-start /usr/local/etc/kafka/zookeeper.properties
$ kafka-server-start /usr/local/etc/kafka/server.properties
$ vim /usr/local/etc/kafka/server.properties
Here uncomment the server settings and update the value from
listeners=PLAINTEXT://:9092
and restart the server and it will work great.
$ kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
$ kafka-console-producer --broker-list localhost:9092 --topic test
>send first message
$ kafka-console-consumer --bootstrap-server localhost:9092 --topic test --from-beginning
$ kafka-topics --zookeeper localhost:2181 --delete --topic test