Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kafka

Check out how to install kafka on windows and Ubuntu or Mac

Index

  1. Command line Kafka Publishing and Consuming test Data
  2. Create a kafka producer topic using springboot and Gradle build application.

1. Command line Kafka Publishing and Consuming test Data

1. Create a kafka topic first.

kafka-topics --create --bootstrap-server localhost:9092 --replication-factor 3 --partitions 6 --topic inv_purchases_data

2. Create a command line producer

 kafka-console-producer --broker-list localhost:9092 --topic inv_purchases_data

3. Create a a command line consumer

 kafka-console-consumer --bootstrap-server localhost:9092 --topic inv_purchases_data --from-beginning

done!

2. Create a kafka producer topic using springboot and Gradle build application

1. Clone the git repo code

git clone https://github.com/sada498/Kafka.git 

Note: I am using Ubuntu to test code and running kafka. To know how to start kafka on windows. click here

2.Start the zookeeper service

./bin/zookeeper-server-start.sh ./config/zookeeper.properties 

3. Start the kafka service

./bin/kafka-server-start.sh ./config/server.properties 

4. change directory to run an application

 cd Kafka/kafka-simple-producer
./gradlew run

Note: If have problem with ./gradlew: command not found

chmod +x gradlew
./gradlew run

5. Check the kafka topic by using shell command

kafka-topics --list --zookeeper localhost:2181

6. check the kafka producer data by using Kafka consumer API command line

kafka-console-consumer --bootstrap-server localhost:9092 --topic AU-weather-report --from-beginning

Done :)

About

Kafka projects , Producer API ,Consumer API , Streams API, Connect API using java

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages