Skip to content

An example Spring Boot project built with Apache Kafka

Notifications You must be signed in to change notification settings

hourmeng12/spring-boot-kafka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot with Kafka

SpringBoot ApacheKafka

An example Spring Boot project built with Apache Kafka.

Setup

Run docker compose file zk-single-kafka-single.yml in detach mode (in terminal)

docker compose -f zk-single-kafka-single.yml up -d 
  • This will set up zookeeper and kafka in the local machine
  • The Apache Kafka server will be localhost:9092

Execute command from kafka in docker

docker exec -it kafka1 /bin/sh

Log message from kafka topic = log

kafka-console-consumer --topic log --from-beginning --bootstrap-server localhost:9092

application.yml connect to kafka server & set server port to 8080

server:
  port: 8080
spring:
  kafka:
    bootstrap-servers: localhost:9092

Run the project with maven or on your ide

./mvnw.cmd

Meta

Hourmeng Khy

About

An example Spring Boot project built with Apache Kafka

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages