-
Download the Kafka 0.10.0.0 binary
cd kafka_2.11-0.10.0.0
-
Run the zookeeper & kafka server
bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties
-
Create the topics manually using the kafka cli
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic odd
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic even
Check if the topics are created
bin/kafka-topics.sh --list --zookeeper localhost:2181
-
Clone this repo
git clone https://github.com/thejasbabu/kafka-example.git
-
Compile and package the project
mvn clean compile package
-
Run the Consumer,Producer and Stream program
java -jar ./target/1-1.0-SNAPSHOT-jar-with-dependencies.jar "consumer"
java -jar ./target/1-1.0-SNAPSHOT-jar-with-dependencies.jar "producer"
java -jar ./target/1-1.0-SNAPSHOT-jar-with-dependencies.jar "stream"
-
Notifications
You must be signed in to change notification settings - Fork 22
thejasbabu/kafka-example
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
A simple Kafka Consumer and Producer example
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published