Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Kafka 0.9.x producer / consumer example

Simple example of using Kafka as message broker with producers and consumers implemented in Java. It's a Spring Boot web application which demonstrates how to create topics, producers and consumers and displays current state of topic partitions, producers speed, consumers speed and offsets in real time.


1.Java 8 installed on your computer


  1. Download Kafka platform 2.0.1 from and unzip it to location of your choice.

  2. Clone this project , build it with gradle wrapper: from the project root run: "./gradlew build" This will produce javacro-kafka.jar located in {project_root}/build/libs

#Runing the demo

##Starting Kafka

  1. Start Zookeeper - Open terminal and navigate to confluent home folder from step 1 of installation run command "bin/zookeeper-server-start etc/kafka/"

  2. Start Kafka broker - Open another terminal, navigate to confluent home folder and run command: "bin/kafka-server-start etc/kafka/"

##Staring demo app

  1. In terminal, navigate to the cloned project root and run: java -jar build/libs/javacro-kafka.jar

  2. Open your browser (Google Chrome recommended) and go to url: http://localhost:9090

#Using the demo First add some topics, then producers, and then consumers. Forms should be self explanatory. Once you have some producers linked to topics, you can change their speed and observe how topic partitions get filled. After you add some consumers you and link them to topics, you can observe consumer speed, and offset on partitions.


Kafka demo for JavaCro 2016 conference



No releases published


No packages published
You can’t perform that action at this time.