<em>Kafdrop is a web UI for viewing Kafka topics and browsing consumer groups.</em> The tool displays information such as brokers, topics, partitions, consumers, and lets you view messages.

This project is a reboot of Kafdrop 2.x, dragged kicking and screaming into the world of Java 17+, Kafka 2.x, Helm and Kubernetes. It's a lightweight application that runs on Spring Boot and is dead-easy to configure, supporting SASL and TLS-secured brokers.
Optional, additional integration:
You can run the Kafdrop JAR directly, via Docker, or in Kubernetes.
java --add-opens=java.base/sun.nio.ch=ALL-UNNAMED \ -jar target/kafdrop-<version>.jar \ --kafka.brokerConnect=<host:port,host:port>,...
If unspecified, kafka.brokerConnect defaults to localhost:9092.
Note: As of Kafdrop 3.10.0, a ZooKeeper connection is no longer required. All necessary cluster information is retrieved via the Kafka admin API.
Open a browser and navigate to http://localhost:9000. The port can be overridden by adding the following config:
--server.port=<port> --management.server.port=<port>
Optionally, configure a schema registry connection with:
--schemaregistry.connect=http://localhost:8081
and if you also require basic auth for your schema registry connection you should add:
--schemaregistry.auth=username:password
Finally, a default message and key format (e.g. to deserialize Avro messages or keys) can optionally be configured as follows:
--message.format=AVRO
--message.keyFormat=DEFAULT
Valid format values are DEFAULT, AVRO, PROTOBUF. This can also be configured at the topic level via dropdown when viewing messages.
If key format is unspecified, message format will be used for key too.
In case of protobuf message type, the definition of a message could be compiled and transmitted using a descriptor file. Thus, in order for kafdrop to recognize the message, the application will need to access to the descriptor file(s). Kafdrop will allow user to select descriptor and well as specifying name of one of the message type provided by the descriptor at runtime.
To configure a folder with protobuf descriptor file(s) (.desc), follow:
--protobufdesc.directory=/var/protobuf_desc
In case of no protobuf descriptor file being supplied the implementation will attempt to create the protobuf deserializer using the schema registry instead.
If preferred the message type could be set to default as follows:
--message.format=PROTOBUF
Images are hosted at hub.docker.com/r/obsidiandynamics/kafdrop.
Launch container in background:
docker run -d --rm -p 9000:9000 \ -e KAFKA_BROKERCONNECT=<host:port,host:port> \ -e SERVER_SERVLET_CONTEXTPATH="/" \ obsidiandynamics/kafdrop
Launch container with some specific JVM options:
docker run -d --rm -p 9000:9000 \ -e KAFKA_BROKERCONNECT=<host:port,host:port> \ -e JVM_OPTS="-Xms32M -Xmx64M" \ -e SERVER_SERVLET_CONTEXTPATH="/" \ obsidiandynamics/kafdrop
Launch container in background with protobuff definitions:
docker run -d --rm -v <path_to_protobuff_descriptor_files>:/var/protobuf_desc -p 9000:9000 \ -e KAFKA_BROKERCONNECT=<host:port,host:port> \ -e SERVER_SERVLET_CONTEXTPATH="/" \ -e CMD_ARGS="--message.format=PROTOBUF --protobufdesc.directory=/var/protobuf_desc" \ obsidiandynamics/kafdrop
Then access the web UI at http://localhost:9000.
Hey there! We hope you really like Kafdrop! Please take a moment to ⭐the repo or Tweet about it.
Clone the repository (if necessary):
git clone https://github.com/obsidiandynamics/kafdrop && cd kafdrop
Apply the chart:
helm upgrade -i kafdrop chart --set image.tag=3.x.x \ --set kafka.brokerConnect=<host:port,host:port> \ --set server.servlet.contextPath="/" \ --set cmdArgs="--message.format=AVRO --schemaregistry.connect=http://localhost:8080" \ #optional --set jvm.opts="-Xms32M -Xmx64M"
For all Helm configuration options, have a peek into chart/values.yaml.
Replace 3.x.x with the image tag of obsidiandynamics/kafdrop. Services will be bound on port 9000 by default (node port 30900).
Note: The context path must begin with a slash.
Proxy to the Kubernetes cluster:
kubectl proxy
Navigate to http://localhost:8001/api/v1/namespaces/default/services/http:kafdrop:9000/proxy.
To install with protobuf support, a "facility" option is provided for the deployment, to mount the descriptor files folder, as well as passing the required CMD arguments, via option mountProtoDesc. Example:
helm upgrade -i kafdrop chart --set image.tag=3.x.x \ --set kafka.brokerConnect=<host:port,host:port> \ --set server.servlet.contextPath="/" \ --set mountProtoDesc.enabled=true \ --set mountProtoDesc.hostPath="<path/to/desc/folder>" \ --set jvm.opts="-Xms32M -Xmx64M"
After cloning the repository, building is just a matter of running a standard Maven build:
$ mvn clean package
The following command will generate a Docker image:
mvn assembly:single docker:build
There is a docker-compose.yaml file that bundles a Kafka/ZooKeeper instance with Kafdrop:
cd docker-compose/kafka-kafdrop docker-compose up
Starting with version 2.0.0, Kafdrop offers a set of Kafka APIs that mirror the existing HTML views. Any existing endpoint can be returned as JSON by simply setting the Accept: application/json header. Some endpoints are JSON only:
/topic: Returns a list of all topics.To help document the Kafka APIs, OpenAPI Specification (OAS) has been included. The OpenAPI Specification output is available by default at the following Kafdrop URL:
/v3/api-docs
It is also possible to access the Swagger UI (the HTML views) from the following URL:
/swagger-ui.html
This can be overridden with the following configuration:
springdoc.api-docs.path=/new/oas/path
You can disable OpenAPI Specification output with the following configuration:
springdoc.api-docs.enabled=false
Starting in version 2.0.0, Kafdrop sets CORS headers for all endpoints. You can control the CORS header values with the following configurations:
cors.allowOrigins (default is *)
cors.allowMethods (default is GET,POST,PUT,DELETE)
cors.maxAge (default is 3600)
cors.allowCredentials (default is true)
cors.allowHeaders (default is Origin,Accept,X-Requested-With,Content-Type,Access-Control-Request-Method,Access-Control-Request-Headers,Authorization)
You can also disable CORS entirely with the following configuration:
cors.enabled=false
By default, you could delete a topic. If you don't want this feature, you could disable it with:
--topic.deleteEnabled=false
By default, you could create a topic. If you don't want this feature, you could disable it with:
--topic.createEnabled=false
Health and info endpoints are available at the following path: /actuator
This can be overridden with the following configuration:
management.endpoints.web.base-path=<path>
Kafdrop supports TLS (SSL) and SASL connections for encryption and authentication. This can be configured by providing a combination of the following files (placed into the Kafka root directory):
kafka.truststore.jks: specifying the certificate for authenticating brokers, if TLS is enabled.kafka.keystore.jks: specifying the private key to authenticate the client to the broker, if mutual TLS authentication is required.kafka.properties: specifying the necessary configuration, including key/truststore passwords, cipher suites, enabled TLS protocol versions, username/password pairs, etc. When supplying the truststore and/or keystore files, the ssl.truststore.location and ssl.keystore.location properties will be assigned automatically.The three files above can be supplied to a Docker instance in base-64-encoded form via environment variables:
docker run -d --rm -p 9000:9000 \ -e KAFKA_BROKERCONNECT=<host:port,host:port> \ -e KAFKA_PROPERTIES="$(cat kafka.properties | base64)" \ -e KAFKA_TRUSTSTORE="$(cat kafka.truststore.jks | base64)" \ # optional -e KAFKA_KEYSTORE="$(cat kafka.keystore.jks | base64)" \ # optional obsidiandynamics/kafdrop
Rather than passing KAFKA_PROPERTIES as a base64-encoded string, you can also place a pre-populated KAFKA_PROPERTIES_FILE into the container:
cat << EOF > kafka.properties security.protocol=SASL_SSL sasl.mechanism=SCRAM-SHA-512 sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="foo" password="bar" EOF docker run -d --rm -p 9000:9000 \ -v $(pwd)/kafka.properties:/tmp/kafka.properties:ro \ -v $(pwd)/kafka.truststore.jks:/tmp/kafka.truststore.jks:ro \ -v $(pwd)/kafka.keystore.jks:/tmp/kafka.keystore.jks:ro \ -e KAFKA_BROKERCONNECT=<host:port,host:port> \ -e KAFKA_PROPERTIES_FILE=/tmp/kafka.properties \ -e KAFKA_TRUSTSTORE_FILE=/tmp/kafka.truststore.jks \ # optional -e KAFKA_KEYSTORE_FILE=/tmp/kafka.keystore.jks \ # optional obsidiandynamics/kafdrop
It's sometimes needed to load extra classes, e.g. for a SASL client callback handler. To facilitate that, it is possible to mount a folder with extra JARs, like this:
cat << EOF > kafka.properties security.protocol=SASL_SSL sasl.jaas.config=software.amazon.msk.auth.iam.IAMLoginModule; sasl.client.callback.handler.class=software.amazon.msk.auth.iam.IAMClientCallbackHandler EOF mkdir extra-kafdrop-classes wget --directory-prefix=extra-kafdrop-classes https://repo1.maven.org/maven2/software/amazon/msk/aws-msk-iam-auth/1.0.0/aws-msk-iam-auth-1.0.0.jar docker run -d --rm -p 9000:9000 \ -v $(pwd)/kafka.properties:/tmp/kafka.properties:ro \ -v $(pwd)/kafka.truststore.jks:/tmp/kafka.truststore.jks:ro \ -v $(pwd)/kafka.keystore.jks:/tmp/kafka.keystore.jks:ro \ -v $(pwd)/extra-kafdrop-classes:/extra-classes:ro \ -e KAFKA_BROKERCONNECT=<host:port,host:port> \ -e KAFKA_PROPERTIES_FILE=/tmp/kafka.properties \ -e KAFKA_TRUSTSTORE_FILE=/tmp/kafka.truststore.jks \ # optional -e KAFKA_KEYSTORE_FILE=/tmp/kafka.keystore.jks \ # optional obsidiandynamics/kafdrop
| Name | Description |
|---|---|
KAFKA_BROKERCONNECT | Bootstrap list of Kafka host/port pairs. Defaults to localhost:9092. |
KAFKA_PROPERTIES | Additional properties to configure the broker connection (base-64 encoded). |
KAFKA_TRUSTSTORE | Certificate for broker authentication (base-64 encoded). Required for TLS/SSL. |
KAFKA_KEYSTORE | Private key for mutual TLS authentication (base-64 encoded). |
SERVER_SERVLET_CONTEXTPATH | The context path to serve requests on (must end with a /). Defaults to /. |
SERVER_PORT | The web server port to listen on. Defaults to 9000. |
MANAGEMENT_SERVER_PORT | The Spring Actuator server port to listen on. Defaults to 9000. |
SCHEMAREGISTRY_CONNECT | The endpoint of Schema Registry for Avro or Protobuf message |
SCHEMAREGISTRY_AUTH | Optional basic auth credentials in the form username:password. |
CMD_ARGS | Command line arguments to Kafdrop, e.g. --message.format or --protobufdesc.directory or --server.port. |
| Name | Description |
|---|---|
JVM_OPTS | JVM options. E.g.JVM_OPTS: "-Xms16M -Xmx64M -Xss360K -XX:-TieredCompilation -XX:+UseStringDeduplication -noverify" |
JMX_PORT | Port to use for JMX. No default; if unspecified, JMX will not be exposed. |
HOST | The hostname to report for the RMI registry (used for JMX). Defaults to localhost. |
KAFKA_PROPERTIES_FILE | Internal location where the Kafka properties file will be written to (if KAFKA_PROPERTIES is set). Defaults to kafka.properties. |
KAFKA_TRUSTSTORE_FILE | Internal location where the truststore file will be written to (if KAFKA_TRUSTSTORE is set). Defaults to kafka.truststore.jks. |
KAFKA_KEYSTORE_FILE | Internal location where the keystore file will be written to (if KAFKA_KEYSTORE is |


职场AI,就用扣子
AI办公助手,复杂任务高效处理。办公效率低?扣子空间AI助手支持播客生成、PPT制作、网页开发及报告写作,覆盖科研、商业、舆情等领域的专家Agent 7x24小时响应,生活工作无缝切换,提升50%效率!


多风格AI绘画神器
堆友平台由阿里巴巴设计团队创建,作为一款AI驱动的设计工具,专为设计师提供一站式增长服务。功能覆盖海量3D素材、AI绘画、实时渲染以及专业抠图,显著提升设计品质和效率。平台不仅提供工具,还是一个促进创意交流和个人发展的空间,界面友好,适合所有级别的设计师和创意工作者。


零代码AI应用开发平台
零代码AI应用开发平台,用户只需一句话简单描述需求,AI能自动生成小程序、APP或H5网页应用,无需编写代码。


免费创建高清无水印Sora视频
Vora是一个免费创建高清无水印Sora视频的AI工具


最适合小白的AI自动化工作流平台
无需编码,轻松生成可复用、可变现的AI自动化工作流

大模型驱动的Excel数据处理工具
基于大模型交互的表格处理系统,允许用户通过对话方式完成数据整理和可视化分析。系统采用机器学习算法解析用户指令,自动执行排序、公式计算和数据透视等操作,支持多种文件格式导入导出。数据处理响应速度保持在0.8秒以内,支持超过100万行数据的即时分析。


AI辅助编程,代码自动修复
Trae是一种 自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。


AI论文写作指导平台
AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。


AI一键生成PPT,就用博思AIPPT!
博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。


AI赋能电商视觉革命,一站式智能商拍平台
潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。
最新AI工具、AI资讯
独家AI资源、AI项目落地

微信扫一扫关注公众号