Kafka for Java Developer - Producer Consumer Topic in kafka Practical

Опубликовано: 16 Октябрь 2024
на канале: Coder Baba
23
like

1.Kafka installation start kafka and zookeeper
2. kafka topic,producer and consumer
4.springboot app for kafka
3. will will talk about some more coammds

1. https://kafka.apache.org/downloads
2. tar xvzf file. tar.

start kafka anad zookeeper

.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
.\bin\windows\kafka-server-start.bat .\config\server.properties


1. -command to create kafka topic in windows :

go inside bin/windows and open terminal and hit command

kafka-topics.bat --bootstrap-server localhost:9092 -topic lunch --create partitions 1 --replication-factor 1


2. How to check list of created topics in windows

kafka-topics.bat --bootstrap-server localhost:9092 --list

3.you can descriibe and check your topic created correctly or not

kafka-topics.bat --bootstrap-server localhost:9092 --describe lunchbox

4. Create kafka producer :
kafka-console-producer.bat --bootstrap-server localhost:9092 --topic lunchbox


5. create kafka consumer
kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic lunchbox
kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic lunchbox --from-beginning

Check list of consumers who consumes the message
6. kafka-consumer-groups.bat --bootstrap-server localhost:9092 --list

7. Describe kafka consumer group

kafka-consumer-groups.bat --bootstrap-server localhost:9092 --describe --group console-consumer-44423

8.offsetlist

kafka-topics.bat --bootstrap-server localhost:9092 --list

9.kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic lunchbox --group hotelgroup



Apache Kafka is an open-source distributed event streaming platform used by thousands of companies for high-performance data pipelines, streaming analytics, data integration, and mission-critical applications