【问题标题】:How to resolve RecordTooLargeException in Kafka Producer?如何解决 Kafka Producer 中的 RecordTooLargeException?
【发布时间】:2019-11-27 07:53:12
【问题描述】:

我正在使用 FlinkKafkaProducer08 将记录发送到 Kafka 。但是有时我会遇到以下异常,即使我在错误消息中打印的记录太小了 0.02 MB 。

java.lang.RuntimeException: Could not forward element to next operator
Caused by: java.lang.RuntimeException: Could not forward element to next operator
Caused by: java.lang.Exception: Failed to send data to Kafka: The message is 1513657 bytes when serialized which is larger than the maximum request size you have configured with the max.request.size configuration.
Caused by: org.apache.kafka.common.errors.RecordTooLargeException: The message is 1513657 bytes when serialized which is larger than the maximum request size you have configured with the max.request.size configuration

尝试更改 producer 上的 max.request.size ,但这需要代理更改并重新启动代理。

【问题讨论】:

    标签: apache-kafka kafka-producer-api


    【解决方案1】:

    还有一个最大消息大小的代理设置:

    message.max.bytes : 1,000,000 (default)
    

    因此,您将需要重新启动您的代理 - 但这应该不是问题。 Kafka 在代理反弹方面以稳健的方式构建。

    参照。 http://kafka.apache.org/082/documentation.html#producerconfigs

    【讨论】:

      猜你喜欢
      • 2018-03-17
      • 1970-01-01
      • 1970-01-01
      • 2018-09-22
      • 2020-07-31
      • 1970-01-01
      • 1970-01-01
      • 2023-04-05
      • 2018-03-23
      相关资源
      最近更新 更多