简体   繁体   English

如何使用 librdkafka 设置 Kafka 消息的最大大小

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

I'm trying to use Kafka to send a message of ~10Mb.我正在尝试使用 Kafka 发送约 10Mb 的消息。 I know its default size is 1Mb, but is that a hard limit?我知道它的默认大小是 1Mb,但这是一个硬性限制吗? Can librdkafka support >10Mb and how do I set it? librdkafka 可以支持 >10Mb 吗,我该如何设置?

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 ).您需要配置主题max.message.bytes (参见https://kafka.apache.org/22/documentation.html#topicconfigs ),并使用message.max.bytes配置生产者(参见https://github.com。 com/edenhill/librdkafka/blob/master/CONFIGURATION.md )。 Please allow some extra space (at least ~500 bytes) for protocol overhead.请为协议开销留出一些额外空间(至少约 500 字节)。

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

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