Spring Boot With Kafka Initial Setup & Configuration Project
- The Project has docker-compose file that can be used to create Kafka Broker.
- Swagger-UI available at
localhost:8080/swagger-ui/index.html
-
Download Kafka on Linux :
-
wget https://archive.apache.org/dist/kafka/3.6.0/kafka_2.13-3.6.0.tgz -
tar xzf kafka_2.13-3.6.0.tgz -
mv kafka_2.13-3.6.0 kafka -
cd kafka/
-
-
Setup Kafka Server using Kraft :
./bin/kafka-storage.sh random-uuid: Generate Cluster Id <cluster_id>./bin/kafka-storage.sh format -t <cluster_id> -c ./config/kraft/server.properties./bin/kafka-server-start.sh ./config/kraft/server.properties---------- Start The Kafka server
Command 2 Creates a /tmp/kraft-combined-logs/ folder
./bin/kafka-storage.sh format -t $(./bin/kafka-storage.sh random-uuid) -c ./config/kraft/server.properties && ./bin/kafka-server-start.sh ./config/kraft/server.properties
./bin/kafka-topics.sh --list --bootstrap-server localhost:9092./bin/kafka-topics.sh --describe --bootstrap-server localhost:9092./bin/kafka-topics.sh --create --topic topic1 --bootstrap-server localhost:9092./bin/kafka-topics.sh --delete --topic topic1 --bootstrap-server localhost:9092
./bin/kafka-console-producer.sh -- topic topic1 -- bootstrap-server localhost:9092./bin/kafka-console-producer.sh --topic topic1 --bootstrap-server localhost:9092 --property="parse.key=true;key.delimiter=:"-- Send msg with key-value