How to set the max size of a Kafka message using librdkafka

有些话、适合烂在心里 提交于 2021-01-28 05:08:21

问题


I'm trying to use Kafka to send a message of ~10Mb. I know its default size is 1Mb, but is that a hard limit? Can librdkafka support >10Mb and how do I set it?


回答1:


You need to configure the topic max.message.bytes (see https://kafka.apache.org/22/documentation.html#topicconfigs), and configure the producer with message.max.bytes (see https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md). Please allow some extra space (at least ~500 bytes) for protocol overhead.



来源:https://stackoverflow.com/questions/60739858/how-to-set-the-max-size-of-a-kafka-message-using-librdkafka

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!