max.request.size出错;RecordTooLargeException异常

解决步骤

1.Kafka者配置文件 server.properties中添加

message.max.bytes=100000000(100M)
replica.fetch.max.bytes=100000000(100M)每个分区试图获取的消息字节数。要大于等于message.max.bytes
  1. 生产者配置文件producer.properties中添加
max.request.size = 100000000(100M)请求的最大大小为字节。要小于 message.max.bytes
  1. 消费者配置文件consumer.properties中添加
fetch.message.max.bytes=100000000(100M)每个提取请求中为每个主题分区提取的消息字节数。要大于等于message.max.bytes
  1. Springboot 配置
 kafka:
    bootstrap-servers: localhost:9092
    producer:
      properties:
        max.request.size: 100000000
  1. 修改成功项目生产者启动答应打印
ProducerConfig values: 
    acks = 1
    batch.size = 100000000
    bootstrap.servers = [127.0.0.1:9092]
    buffer.memory = 100000000
    client.id = 
    compression.type = none
    connections.max.idle.ms = 540000
    enable.idempotence = false
    interceptor.classes = null
    key.serializer = class org.apache.kafka.common.serialization.StringSerializer
    linger.ms = 0
    max.block.ms = 60000
    max.in.flight.requests.per.connection = 5
    max.request.size = 100000000
    metadata.max.age.ms = 300000
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容