Make sure ZooKeeper and Kafka servers are running before executing these commands
(ZooKeeper on localhost:2181 by default, Kafka on localhost:9092
D:\kafka_2.13-3.9.1\bin\windows\zookeeper-server-start D:\kafka_2.13-3.9.1\config\
zookeeper.properties
D:\kafka_2.13-3.9.1\bin\windows\kafka-server-start D:\kafka_2.13-3.9.1\config\
server.properties
D:\kafka_2.13-3.9.1\bin\windows>kafka-topics --create --bootstrap-server
localhost:9092 --replication-factor 1 --partitions 1 --topic rakesh-tpc
D:\kafka_2.13-3.9.1\bin\windows>kafka-console-producer --bootstrap-server
localhost:9092 --topic rakesh-tpc
>hai
>123
D:\kafka_2.13-3.9.1\bin\windows>kafka-console-consumer.bat --bootstrap-server
localhost:9092 --topic rakesh-tpc
hello
hai
123
logs-storage
1) \tmp\zookeeper\version-2
2) /tmp/kafka-logs
Kafka organizes logs in the log.dirs directory as subdirectories named topicName-
partitionNumber
Inspect the Log File -
D:\kafka_2.13-3.9.1\bin\windows\kafka-dump-log.bat --files D:\tmp\kafka-logs\
rakesh-tpc-0\00000000000000000000.log --print-data-log
D:\kafka_2.13-3.9.1\bin\windows\kafka-dump-log.bat --files D:\tmp\kafka-logs\
rakesh-test-tpc-0\00000000000000000000.log --print-data-log
>D:\kafka_2.13-3.9.1\bin\windows\kafka-dump-log.bat --files D:\Java-Details\kafka-
demo\kafka-logs\rakesh-test-1-tpc-0\00000000000000000000.log --print-data-log
Kafka’s retention policies:
Check log.retention.hours or log.retention.ms in server.properties (default is 168
hours, or 7 days).
Check log.retention.bytes for size-based retention (default is -1, meaning no size
limit
mvn clean install
mvn spring-boot:run