Sunday, July 7, 2024

SETUP KAFKA

SETUP KAFKA

Step-1:

Download Kafka software from https://kafka.apache.org/downloads

Extracting directory:  D:/kafka_2.12-3.7.0

Step-2:

Configure zookeeper.properties

# the directory where the snapshot is stored.

dataDir=D:/kafka_2.12-3.7.0/zookeeper //D:/kafka_2.12-3.7.0/ location where kafka has extracted.

Start Zookeeper:

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

Start Kafka:

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

Configure server.properties

# A comma separated list of directories under which to store log files

log.dirs=D:/kafka_2.12-3.7.0/kafka-logs

Run: jsp

Create Topics:

D:\kafka_2.12-3.7.0\bin\windows>kafka-topics.bat --create --bootstrap-server localhost:9092 --topic test

Created topic test.

Step-3:

Start Kafka Producer:

D:\kafka_2.12-3.7.0\bin\windows>kafka-console-producer.bat --broker-list localhost:9092 --topic test

>debo

>hello debo

>thank

>have u seen me

>well done

>then how can i see u

>cls

>clear

>where do u leave


Kafka Consumer Receive Request:

D:\kafka_2.12-3.7.0\bin\windows>kafka-console-consumer.bat --topic test --bootstrap-server localhost:9092 --from-beginning

debo

hello debo

thank

have u seen me

well done

then how can i see u

cls

clear

where do u leave






No comments: