简体   繁体   English

基于控制台的 dockerized kafka 消费者

[英]Console based consumer for dockerized kafka

I have docker container running kafka.我有 docker 容器运行 kafka。 Once I push the message I want to run a console based consumer and listen from the particular topic.推送消息后,我想运行基于控制台的消费者并收听特定主题。 is there any way to do that?有什么办法吗?

Kafka Cheatsheet FYR,卡夫卡备忘单 FYR,

Console Producer & Consumer控制台生产者和消费者

kafka-console-consumer --zookeeper localhost:2181/kafka --topic  topic_name --from-beginning
kafka-console-producer --broker-list localhost:9092 --topic topic_name
kafka-topics --zookeeper localhost:2181/kafka --list

Topic details & Deleting topic主题详情 & 删除主题

kafka-topics --describe --zookeeper localhost:2181/kafka --topic topic_name
kafka-configs --zookeeper localhost:2181/kafka --alter --entity-type topics --entity-name topic_name --add-config retention.ms=1000
kafka-topics --delete --zookeeper localhost:2181/kafka --topic topic_name

Check active brokers检查活跃的经纪人

zookeeper-shell localhost:2181/kafka ls /brokers/ids

KafkaCat卡夫卡猫

kafkacat -b localhost:9092 -L | grep topic
kafkacat -C -b localhost:9092 -o -5 -t topic_name

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM