kafka message size

一:异常信息

21/09/23 10:39:46 ERROR internals.ErrorLoggingCallback: Error when sending message to topic ad_source_mob_prtsc with key: null, value: 5242233 bytes with error:
org.apache.kafka.common.errors.RecordTooLargeException: The message is 5242321 bytes when serialized which is larger than the maximum request size you have configured with the max.request.size configuration.
>21/09/23 10:39:46 ERROR internals.ErrorLoggingCallback: Error when sending message to topic ad_source_mob_prtsc with key: null, value: 6376666 bytes with error:
org.apache.kafka.common.errors.RecordTooLargeException: The message is 6376754 bytes when serialized which is larger than the maximum request size you have configured with the max.request.size configuration.

二:处理办法

都知道是配置***max***size的配置项,但细节往往容易忽略:

  1. server、producer、consumer都需要配置
  2. server中有两个,其中【message.max.bytes】是个临界,设为aMb,后面的配置需要根据临界调整
  3. producer中的【max.request.size】要小于等于临界a
  4. consumer中的【fetch.message.max.bytes】要大于等于临界a
  5. server中还有另一个【replica.fetch.max.bytes】,这个是每个分区尝试获取的字节数

 总结一下就是小心使得万年船。

对了,最后还要记得重启kafka才能生效。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值