Site icon LCDUNG

How to install Apache Kafka on localhost

This tutorial assumes you are starting fresh and have no existing Kafka or ZooKeeper data.

Refer: https://kafka.apache.org/quickstart

Install and start Kafka

Use any features of Kafka

Create a topic

Send some messages

Kafka comes with a command line client that will take input from a file or from standard input and send it out as messages to the Kafka cluster. By default, each line will be sent as a separate message.

Run the producer and then type a few messages into the console to send to the server.

Start a consumer

Kafka also has a command line consumer that will dump out messages to standard output.

If you have each of the above commands running in a different terminal then you should now be able to type messages into the producer terminal and see them appear in the consumer terminal.

All of the command line tools have additional options; running the command with no arguments will display usage information documenting them in more detail.

Exit mobile version