Skip to content

ahmetzumber/kafka-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kafka Commands

STEP 1: Get Kafka

tar -xzf kafka_2.13-3.2.1.tgz
cd kafka_2.13-3.2.1

STEP 2: Start The Kafka Environment

We started to run seperate two service for Kafka as called Zookeeper and Kafka broker service.

# Start the ZooKeeper service
$ bin/zookeeper-server-start.sh config/zookeeper.properties

Open another terminal session and run:

# Start the Kafka broker service
$ bin/kafka-server-start.sh config/server.properties

STEP 3: Create a Topic

Open another terminal session and run to create a topic.

$ bin/kafka-topics.sh --create --topic ${topic_name} --bootstrap-server localhost:9092

STEP 4: Write Some Events into the Topic

$ bin/kafka-console-producer.sh --topic ${topic_name} --bootstrap-server localhost:9092
This is my first event
This is my second event

You can stop the event producing with CTRL+C.

STEP 5: Reading The Events

Open another terminal session and run the console consumer client to read the events you just created.

$ bin/kafka-console-consumer.sh --topic ${topic_name} --from-beginning --bootstrap-server localhost:9092

References

https://kafka.apache.org/quickstart

About

This repo includes basic kafka tutorials.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages