Skip to content

Instantly share code, notes, and snippets.

View anuragrana's full-sized avatar

Anurag Rana anuragrana

View GitHub Profile
@anuragrana
anuragrana / kafka-cheat-sheet.md
Created May 16, 2020 11:59 — forked from ursuad/kafka-cheat-sheet.md
Quick command reference for Apache Kafka

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Describe a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

#!/bin/env python
import sys
import SocketServer
import BaseHTTPServer
import SimpleHTTPServer
class ThreadingSimpleServer(SocketServer.ThreadingMixIn,
BaseHTTPServer.HTTPServer):