springboot kafka 怎么配置 max.request.size

项目使用 springboot + kafka,有一个消息的内容比较大,出现了下面的异常
The message is 1330537 bytes when serialized which is larger than the maximum request size you have configured with the max.request.size configuration.

但是找了半天,不知道这个到底怎么配置,追踪了下源码也没看明白。哪位大神指导下?

其他的配置在 application.properties 中配置如下,
spring.kafka.bootstrap-servers=****
spring.kafka.consumer.group-id=vprGroup
spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.ByteArrayDeserializer
spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.ByteArrayDeserializer
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.ByteArraySerializer
spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.ByteArraySerializer

想按照上面的格式这么配也不行
spring.kafka.producer.max-request-size=2097152

这个是配置kafka的,需要在 server.properties producer.properties kafka-rest.properties中设置这个为一个比较大的值。

参考 https://www.cnblogs.com/lixyu/p/9404144.html

https://blog.csdn.net/xiaoyu_bd/article/details/52319302三个配置要改

https://blog.csdn.net/xiaoyu_bd/article/details/52319302