【问题标题】:org.apache.kafka.common.errors.RecordTooLargeException: The request included a message larger than the max message size the server will acceptorg.apache.kafka.common.errors.RecordTooLargeException:请求包含的消息大于服务器将接受的最大消息大小
【发布时间】:2019-03-15 19:29:01
【问题描述】:

我使用的是 kafka 2.11,出现以下异常

2019-03-15 16:41:19.469 错误 32539 --- [广告 |生产者-1] o.s.k.support.LoggingProducerListener :抛出异常时 使用 key='null' 和 payload='[{"id":1,"name":"Tow 发送消息 Motor","description":"牵引电机从第二个移动 row","xcoordinate":"2264"...' to topic Kafka_Json1:

org.apache.kafka.common.errors.RecordTooLargeException:请求 包含大于服务器最大消息大小的消息 接受。

【问题讨论】:

    标签: spring spring-boot apache-kafka


    【解决方案1】:

    message.max.bytes=100000000 // 增加 server.properties 中的大小 文件说 E.x 100 MB

    max.request.size=100000000 // 在 producer.properties 文件中说 E.x 100 MB

    max.partition.fetch.bytes=100000000 // 在 consumer.properties 文件中,以便消费者可以接收数据说 E.x 100 MB

    并重启 kafka 代理

    【讨论】:

      【解决方案2】:

      默认情况下,Kafka 接受大小为 1 MB 的消息。您的邮件大小超过默认大小。

      您需要更改属性 max.request.size、message.max.bytes 和 max.partition.fetch.bytes 的值来解决此问题。

      【讨论】:

      • 该死的财产在哪里,你能说得更具体点吗?
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-13
      • 1970-01-01
      • 2010-09-27
      • 1970-01-01
      • 2015-04-02
      • 2011-08-02
      相关资源
      最近更新 更多