Kafdrop — Kafka Web UI — Quick Start Example
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
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 upOnce 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\"}"
doneOpen Kafdrop URL http://localhost:19000/ in the browser. Kafdrop will show the topics, brokers, and Kafka Cluster Overview information on Home Page.
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.
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.
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.





