# Change directory to Kafka's installation on directory
cd /Kafka
# Run Zookeeper from the bin folder but redirect the outputs to null so that
# messages from Zookeeper don't get mixed-up with messages from Kafka on the console
bin/zookeeper-server-start.sh config/zookeeper.properties > /dev/null 2>&1 &
# You can run the following command to verify that Zookeeper is indeed running
ps -aef
# Run the Kafka service. You should see output from the service on the console.
# Hit Enter key when the output stops to return to the console.
bin/kafka-server-start.sh config/server.properties &
# At this point you have a basic Kafka environment setup and running.
# Create a topic 'datajek-events' to publish to.
bin/kafka-topics.sh --create --topic datajek-topic --bootstrap-server localhost:9092
# Write some messages to the 'datajek-events' topic
bin/kafka-console-producer.sh --topic datajek-topic --bootstrap-server localhost:9092
# Press Ctrl+C to stop the producer
# Read the messages written to the topic by running the consumer
bin/kafka-console-consumer.sh --topic datajek-topic --from-beginning --bootstrap-server localhost:9092
# You should see all the messages you typed earlier, displayed on the console. Press
# Ctrl+C anytime to stop the consumer.