Skip to content

Instantly share code, notes, and snippets.

@yagizdemirsoy
Last active August 19, 2017 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yagizdemirsoy/9a9cbe1a7583a59bd6d73c3050f9df7a to your computer and use it in GitHub Desktop.
Save yagizdemirsoy/9a9cbe1a7583a59bd6d73c3050f9df7a to your computer and use it in GitHub Desktop.
Kafka Topic Specific Commands

Create Kafka Topic

kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic product-raw-data

Update Kafka Topic Configuration

kafka-configs.sh --zookeeper localhost:2181 --entity-type topics --entity-name product-raw-data --alter --add-config max.message.bytes=1000000

Delete Kafka Topic

kafka-topics --delete --zookeeper localhost:2181 --topic product-raw-data

Get All Messages In Topic

kafka-console-consumer --bootstrap-server localhost:9092 --topic product-raw-data --from-beginning

Update Topic Parition

kafka-topics --zookeeper localhost:2181 --alter --topic product-raw-data --partitions 2

Add New Message To Topic

kafka-console-producer --broker-list localhost:9092 --topic topic_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment