15 Kafka CLI Commands For Everyday Programming

Demonstrating the use of the most commonly used Kafka Command Line Interface Commands

Giorgos Myrianthous
7 min readMar 16, 2022

--

laptop
Photo by Blake Connally on Unsplash

Introduction

Apache Kafka is one of the most commonly used technologies that facilitate even-streaming architectures. Despite often being seen as *just* a message broker (like RabbitMQ for example), Kafka is definitely way more than just this.

Kafka was an internal LinkedIn project which was open sourced in 2011 and quickly evolved from a message broker to a complete platform that enables even-streaming in a highly scalable, fault-tolerant distributed manner.

In today’s article, we will go through some of the most commonly used commands in Kafka’s command line interface. Make sure to bookmark this tutorial as the chances are you will need to reference some parts quite often when performing certain administration tasks over Kafka clusters.

1. How To List All Topics in a Kafka Cluster

If you want to list the topics included in a specific broker, the following command will do the trick:

$ kafka-topics \
--bootstrap-server localhost:9092 \
--list

--

--

Giorgos Myrianthous

I strive to build data-intensive systems that are not only functional, but also scalable, cost effective and maintainable over the long term.