Skip to content

Simple example of Kafka producer and consumer with Docker

Notifications You must be signed in to change notification settings

codegard/kafka-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kafka with Docker

How to run application

To run application you need to have installed Docker with Docker Compose.

After clone set services.kafka.environment.KAFKA_ADVERTISED_HOST_NAME in docker-compose.yml to your Docker instance IP address and then type

docker-compose up --build

in main directory with docker-compose.yml file to build and run application

After that all components like Zookeeper, Kafka broker, Kafka consumer and Kafka producer should be ready. You don't need to install Kafka or Java, in your Docker terminal you should see information about consumed and skipped messages.

Producer

Kafka producer is sending two types of message - Person and Orc. Person message is sent every 2 seconds, Orc is sent every 5 seconds.

Consumer

Kafka consumer is adjusted only to Person message, each Orc message will be skipped after deserialization attempt.

Authors

About

Simple example of Kafka producer and consumer with Docker

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published