Kafka Useful Commands

First time trying with Kafka

Install Kafka on Mac locally

Run Zookeeper and Kafka

Create topic

Run producer console

Write each message into the topic separate by pressing ENTER; then press CTR+C to exit the console.

Run consumer console

List Kafka topics

Describe a topic

To update the configuration for a Kafka topic

For example, retention.ms

To delete configuration in a topic

For example, retention.ms

To check the beginning and ending offset

Kafka delete records in partitions from earliest offset to specific offset

offset-json.json:

-1 is the last offset.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store