gpt4 book ai didi

apache-kafka - Kafkacat:如何删除主题或其所有消息?

转载 作者:行者123 更新时间:2023-12-03 14:43:17 24 4
gpt4 key购买 nike

我正在寻找一种使用 kafkacat 删除主题或其所有消息的方法.
是否可能或唯一的方法是通过列出的脚本here ?

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

最佳答案

根据手册页和github源代码,kafkacat中现阶段没有删除主题功能。所以唯一的方法是使用 kafka-topics 脚本。

github source code

man page

kafkacat is a generic non-JVM producer and consumer for Apache Kafka 0.8, think of it as a netcat for Kafka.

 In producer mode ( -P ), kafkacat reads messages from stdin, delimited with a configurable
delimeter and produces them to the provided Kafka cluster, topic and partition. In consumer
mode ( -C ), kafkacat reads messages from a topic and partition and prints them to stdout
using the configured message delimiter.

If neither -P or -C are specified kafkacat attempts to figure out the mode automatically
based on stdin/stdout tty types.

kafkacat also features a metadata list mode ( -L ), to display the current state of the
Kafka cluster and its topics and partitions.

关于apache-kafka - Kafkacat:如何删除主题或其所有消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55760020/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com