Sitemap

Kafdrop — Kafka Web UI — Quick Start Example

2 min readNov 19, 2022

--

Introduction

Kafdrop is an open-source web application to view Kafka brokers, topics, messages, consumer groups, and ACLs. New Topics can also be created using Kafdrop.

More about Kafdrop can be found here.

Tools

The below tools are required to run this quick-start application

  1. Docker
  2. Docker Compose

Kafka Producer and Consumer Example

Let’s use the application from Spring Boot Kafka Producer and Consumer example post to demonstrate Kafdrop GUI functionality to view events.

Get Jeyaganesh Selvaraj’s stories in your inbox

Join Medium for free to get updates from this writer.

We will use the below docker-compose to bring Kafka, Schema Registry, Kafka Producer App, and Kafdrop services up & running

Execute the docker-compose command below from the project directory to start Kafka, Schema Registry, Kafka Producer, and Kafdrop services

docker-compose up

Once all the services are up and running, let’s send the sale events using cURL

for i in {1..100}
do
curl -H 'Content-Type: application/json' -u 'admin:admin' localhost:15454/sale \
-d "{\"itemId\":\"$i\",\"quantity\": 0, \"saleDate\":\"20221028T220909.999\",\"unitPrice\":23.99,\"sellerID\":\"S-$i\"}"
done

Open Kafdrop URL http://localhost:19000/ in the browser. Kafdrop will show the topics, brokers, and Kafka Cluster Overview information on Home Page.

Press enter or click to view image in full size

Click the sale_events link to view all the messages in the sale_events topic. This page list all the details about the partition and the messages under each partition.

Press enter or click to view image in full size

Let’s select partition-0 to view one message. Kafdrop supports Apache Avro messages and JSON out of the box.

The example Kafka Producer application uses String key format and Apache Avro value format. Key format and value format are selected respectively.

Press enter or click to view image in full size

JSON messages can be expanded to view in a pretty format

{
"itemId": 21,
"quantity": 0,
"saleDate": "20221028T220909.999",
"sellerID": "S-21",
"unitPrice": 23.99
}

Conclusion

We just covered how to browse messages in this post. Kafdrop comes with many other features. Docker composes file for this example can be found on GitHub.

Thank you !!!

--

--

Jeyaganesh Selvaraj
Jeyaganesh Selvaraj

Written by Jeyaganesh Selvaraj

Professional programmer. Interested to explore new programming languages.