filmov
tv
KAFKA | TOPIC ON CLI | COMMAND LINE | TOPIC COMMANDS
![preview_player](https://i.ytimg.com/vi/BJC32gq3ozs/maxresdefault.jpg)
Показать описание
List Topics : kafka-topics --bootstrap-server localhost:9092 --list
Create Topic : kafka-topics --bootstrap-server localhost:9092 --topic 2ndTopic --create //2ndTopic is topic name
Delete Topic : kafka-topics --bootstrap-server localhost:9092 --delete --topic 2ndTopic
Describe : kafka-topics --bootstrap-server localhost:9092 --describe
Partition : kafka-topics --bootstrap-server localhost:9092 --topic 5thTopic --create --partitions 3
Replication : kafka-topics --bootstrap-server localhost:9092 --topic 5thTopic --create --partitions 3 --replication-factor 2
Producer
-------------
kafka-console-producer
kafka-console-producer --bootstrap-server localhost:9092 --topic 1stTopic --producer-property acks=all //To set ack or any property
Consumer
--------------
kafka-console-consumer --bootstrap-server localhost:9092 --topic 1stTopic // will read from latest offset
kafka-console-consumer --bootstrap-server localhost:9092 --topic 1stTopic --from-beginning //To read from beginning
Create Topic : kafka-topics --bootstrap-server localhost:9092 --topic 2ndTopic --create //2ndTopic is topic name
Delete Topic : kafka-topics --bootstrap-server localhost:9092 --delete --topic 2ndTopic
Describe : kafka-topics --bootstrap-server localhost:9092 --describe
Partition : kafka-topics --bootstrap-server localhost:9092 --topic 5thTopic --create --partitions 3
Replication : kafka-topics --bootstrap-server localhost:9092 --topic 5thTopic --create --partitions 3 --replication-factor 2
Producer
-------------
kafka-console-producer
kafka-console-producer --bootstrap-server localhost:9092 --topic 1stTopic --producer-property acks=all //To set ack or any property
Consumer
--------------
kafka-console-consumer --bootstrap-server localhost:9092 --topic 1stTopic // will read from latest offset
kafka-console-consumer --bootstrap-server localhost:9092 --topic 1stTopic --from-beginning //To read from beginning