Starting Kafka
At this point, Kafka has already been installed and all we have to do is start the service.
Step 1
Let first start the Zookeeper service. In a new terminal (Window > New terminal or Alt-T
) run the following script.
Step 2
Next, let's start the Kafka service. In a new terminal (Window > New terminal or Alt-T
) run the following script.
Tip: You can stop the services using the following commands:
Step 3
Let's try out Kafka. We will have a producer to send messages to a topic that a consumer will be reading.
Producer In a new terminal (Window > New terminal or Alt-T
) run the following command:
Ignore any warnings
Consumer In a new terminal (Window > New terminal or Alt-T
) run the following command:
Ignore any warnings
We are now ready to broker messages. In the Producer terminal, type some text and press enter
. In the Consumer terminal you should see your text getting read.
Last updated
Was this helpful?