whose size is larger than the fetch size

whose size is larger than the fetch size,第1张

whose size is larger than the fetch size 1  整体异常描述
org.apache.kafka.common.errors.RecordTooLargeException: There are some messages at [Partition=Offset]: {ME1000002013-8=4791187} whose size is larger than the fetch size 1048576 and hence cannot be returned. Please considering upgrading your broker to 0.10.1.0 or newer to avoid this issue. Alternately, increase the fetch size on the client (using max.partition.fetch.bytes)

  

 2  背景        

   1)  消息队列使用的是Kafka

   2)  客户端消费者使用spring boot方式进行的集成

 3  原因分析

    1048576字节=1MB,消费者在消费Kafka消息的时候,默认会进行单条消息大小的控制,默认

值就是1MB。

 4  解决方案

   spring boot  配置文件加入配置,设置拉取消息的最大值即可

 

spring:
  kafka:
    consumer:
      properties:
        max.partition.fetch.bytes: 104857600

  

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/zaji/5606233.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-15
下一篇 2022-12-15

发表评论

登录后才能评论

评论列表(0条)

保存