生产环境中利用kafka作为消息队列,生产者发送消息失败,查询报错日志,得到如下输出:
Caused by: org.springframework.kafka.KafkaException: Send failed; nested exception is org.apache.kafka.common.errors.RecordTooLargeException: The message is 4067035 bytes when serialized which is larger than 1048576, which is the value of the max.request.size configuration.
这个错误信息表明生产者实验发送到Kafka的消息在序列化后巨细为4067035字节(约4MB),超过了Kafka配置中的max.request.size参数的限制,该参数当前设置为1048576字节(1MB)
二、缘故原由