如何使用 librdkafka 设置 Kafka 消息的最大大小 [英] How to set the max size of a Kafka message using librdkafka

查看:60
本文介绍了如何使用 librdkafka 设置 Kafka 消息的最大大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Kafka 发送约 10Mb 的消息.我知道它的默认大小是 1Mb,但这是一个硬性限制吗?librdkafka 是否可以支持 >10Mb 以及如何设置?

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?

推荐答案

您需要配置主题 max.message.bytes(请参阅 https://kafka.apache.org/22/documentation.html#topicconfigs),并使用 message 配置生产者.max.bytes(见 https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md).请为协议开销留出一些额外空间(至少约 500 字节).

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.

这篇关于如何使用 librdkafka 设置 Kafka 消息的最大大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆