This is a basic application that uses kafka to demonstrate producer and consumer relationship and functionalities, how they work. Location is being generated randomly from one service and being consumed by another service simultaneously.
- Random Location Producr
- Location details being consumed and updated to subscribers or consumers at real time
Kafka Commands for windows used in this project via cmd after selecting kafka files that contains bin folder
Start Zookeeper server
bin\windows\zookeeper-server-start.bat config\zookeeper.properties
Start kafka server
bin\windows\kafka-server-start.bat config/server.properties
Create Topics
bin\windows\kafka-topics.sh --create --topic user-topic --bootstrap-server localhost:9092
Produce new Topics for testing
bin\windows\kafka-console-producer.bat --topic user-topic --bootstrap-server localhost:9092
>Testing Message
Consume created topics for testing
bin\windows\kafka-console-consumer.bat --topic user-topic --from-beginning --bootstrap-server localhost:9092
Check following configurations Change DB details accordingly
#server
server.port=8081
#Consumer Config
spring.kafka.consumer.bootstrap-servers=localhost:9092
spring.kafka.consumer.group-id=group-1
spring.kafka.consumer.auto-offset-reset=earliest
spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer
spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.StringDeserializer
Clone the project
git clone https://github.com/subhajit51193/KafkaLocationApp.git
Go to the project directory
cd KafkaLocationApp
cd EdnUserApp
Install dependencies
mvn clean install
Start the server
mvn spring-boot:run
Check following configurations Change DB details accordingly
#Producer Config
spring.kafka.producer.bootstrap-servers=localhost:9092
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
Clone the project
git clone https://github.com/subhajit51193/KafkaLocationApp.git
Go to the project directory
cd KafkaLocationApp
cd FoodDeliveryBoyApp
Install dependencies
mvn clean install
Start the server
mvn spring-boot:run
Not Deployed
Client: Java, SpringBoot, Kafka
DataBase: N/A
Server: Embedded Tomcat
If you have any feedback, please reach out to us at [email protected]