问题描述
限时送ChatGPT账号..kafka 有没有办法清除话题?
我将过大的消息推送到本地计算机上的 kafka 消息主题中,现在出现错误:
I pushed a message that was too big into a kafka message topic on my local machine, now I'm getting an error:
kafkamon.InvalidMessageSizeException: invalid message size
在这里增加 fetch.size
并不理想,因为我实际上不想接受那么大的消息.
Increasing the fetch.size
is not ideal here, because I don't actually want to accept messages that big.
推荐答案
临时更新主题的保留时间为一秒:
Temporarily update the retention time on the topic to one second:
kafka-topics.sh --zookeeper <zkhost>:2181 --alter --topic <topic name> --config retention.ms=1000
在较新的 Kafka 版本中,您也可以使用 kafka-configs --entity-type 主题
And in newer Kafka releases, you can also do it with kafka-configs --entity-type topics
kafka-configs.sh --zookeeper <zkhost>:2181 --entity-type topics --alter --entity-name <topic name> --add-config retention.ms=1000
然后等待清除生效(持续时间取决于主题的大小).清除后,恢复之前的 retention.ms
值.
then wait for the purge to take effect (duration depends on size of the topic). Once purged, restore the previous retention.ms
value.
这篇关于清除卡夫卡主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论