Skip to content

Rapter1990/springbootkafka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot and Apache Kafka via Docker

Main Information

📖 Information

  • It is a distributed message system which is based on Publisher and Consumer
  • All messages are combined under one category.Consumers can fetch data from different kinds of category. Publisher is called as an app of sending message while consumer is called as an app of gettting message.
  • The app contains Kafka to collect data and then direct it to the system quickly and flawlessly instead of keeping it as a huge data. That's why it prevents data loss.
  • The app contains zookeper to inform Producer and Consumer about each node of Kafka or Broker when it doesn't work
  • The app uses Docker to run it in different kinds of platform
    • Define Kafka and zookeper in its container instead of setting up each one seperately as a virtualization

🔨 Run the App

1 ) Install Docker Desktop. Here is the installation link : https://docs.docker.com/docker-for-windows/install/

2 ) Install Apache Kafka on Docker. Here is the installation link : https://hub.docker.com/r/ches/kafka/

    docker pull ches/kafka

3 ) Add zookeeper on Docker Container

    docker run --rm --name zookeeper -p 2181:2181 jplock/zookeeper 

4 ) Add kafka on Docker Container

    docker run --rm -p 9092:9092 -e KAFKA_ADVERTISED_HOST_NAME=127.0.0.1 --link zookeeper:zookeeper ches/kafka

5 ) Show all containers which run on Docker

    docker ps 

6 ) Get a POST request in Postman ( localhost:8080/kafkamessage)

    {
        "message" : "Write any message"
    }

7 ) Use the command to start any container of Docker after a closing process is over

    docker start container_id

Screenshots

Click here to show the screenshots of project

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Releases

No releases published

Packages

No packages published

Languages