无法将大文件发送给Kafka经纪人|错误消息:请求包含的消息大于服务器将接受的最大消息大小

问题描述 投票:2回答:2

我无法将大文件发送到代理,我已经在客户端程序中编辑了配置文件,但是没有用。

  • 错误消息

    该请求包含的消息大于服务器将接受的最大消息大小。

  • 服务器属性

    message.max.bytes=900000000
    replica.fetch.max.bytes=900000000
    
  • 制作人

    max.request.size=100000000 
    
  • 消费者

    max.partition.fetch.bytes=100000000
    fetch.message.max.bytes=100000000
    
  • 客户端应用

    props.put("max.request.size",96214400);
    props.put("message.max.bytes",96214400);
    
apache-kafka apache-kafka-streams
2个回答
1
投票

正在评论以回答...

message.max.bytes是群集范围的设置,您需要确保在主题级别也设置了相应的max.message.bytes配置。由于主题级别的配置默认为1048588,因此您会看到此错误。


1
投票
kafka-topics.bat --create --zookeeper 127.0.0.1:2181 --replication-factor 1 --partitions 1 --topic test --config max.message.bytes=9000000
© www.soinside.com 2019 - 2024. All rights reserved.