清除卡夫卡主题

编程入门 行业动态 更新时间:2024-10-26 23:36:44
本文介绍了清除卡夫卡主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-04-19 14:26:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/963807.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:卡夫卡   主题

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!