Kafka topics

This page describes the commands to manage Kafka topics via the Lenses CLI.

View all topics

The optional names flag wil display only the names of the topics. If you use the –unwrap flag, each topic name will be displayed on a new line as text:

lenses-cli topics [--names [--unwrap]]

View a specific topic

lenses-cli topic --name=reddit_posts

Create topics

lenses-cli topic create \
    --name="topicName" \
    --replication=1 \
    --partitions=1 \
    --configs="{\"max.message.bytes\": \"1000010\"}"

Update from a file:

lenses-cli topic create ./topic.yml

Example file:

name: topicName
replication: 1
partitions: 1
configs:
  max.message.bytes: "1000010"

Update a topic’s configuration

Update from a file:

Example file:

Update a topic’s metadata configuration

Update from a file:

Example file:

Delete topics

Last updated

Was this helpful?