Kafka Server写数据的时候报错org.apache.kafka.common.errors.RecordTooLargeException

向Kafka中输入数据,抛异常org.apache.kafka.common.errors.RecordTooLargeException

官网两个参数描述如下:

message.max.bytes The maximum size of message that the server can receive int 1000012 [0,...] high
fetch.message.max.bytes 1024 * 1024 The number of byes of messages to attempt to fetch for each topic-partition in each fetch request. These bytes will be read into memory for each partition, so this helps control the memory used by the consumer. The fetch request size must be at least as large as the maximum message size the server allows or else it is possible for the producer to send messages larger than the consumer can fetch.

message.max.bytes:server能接受消息体的最大值。

fetch.message.max.bytes:consumer从partition中获取消息体放入内存中,这个参数控制conusmer所用的内存大小。如果message.max.bytes大于fetch.message.max.bytes,就会导致consumer分配的内存放不下一个message。

因此,在server.properties中添加两个配置项

#broker能接收消息的最大字节数
message.max.bytes=20000000
#broker可复制的消息的最大字节数
replica.fetch.max.bytes=20485760

如果不想修改配置文件,可以采用修改topic配置的方法,与server配置项message.max.bytes对应的topic配置项是max.message.bytes

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic my-topic
    --config max.message.bytes=128000
时间: 2024-10-14 11:24:45

Kafka Server写数据的时候报错org.apache.kafka.common.errors.RecordTooLargeException的相关文章

C# 访问数据的时候报错 (拒绝了对对象 'XXXX' (数据库 'SHQY',架构 'dbo')的 SELECT 权限)

拒绝了对对象 'XXXX' (数据库 'SHQY',架构 'dbo')的 SELECT 权限 解决办法 use [docareMZ]--docareMZ 数据库名 GO GRANT SELECT ON SCHEMA::[dbo] TO [public] --查 use [docareMZ] GO GRANT EXECUTE ON SCHEMA::[dbo] TO [public] C# 访问数据的时候报错 (拒绝了对对象 'XXXX' (数据库 'SHQY',架构 'dbo')的 SELECT

Microsoft SQL Server 2008 R2附加数据库报错5120解决办法

Microsoft SQL Server 2008 R2数据库附加报错5120,是权限的问题解决办法:邮件数据库文件的属性选中Authenticated Users 然后选中编辑把完全控制勾选上 单击确定,然后就可以附加数据库了 ! 若有疑问可以联系我www.jiangyong.net.cn,里面有我的QQ

1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server解决Navicat连接MySQL报错

最近使用Navicat for MySQl访问远程mysql数据库,出现报错,显示"1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server".解决办法如下: 方法/步骤 首先看报错窗口. 经查阅,错误原因是:本地IP(xxx.xxx.xxx.xxx)没有访问远程数据库的权限. 于是下面开启本地IP(xxx.xxx.xxx.xxx)对远程mysql数据库的访问权限. 首先远程连接进入服务器,在

Tomcat启动报错[org.apache.struts2.dispatcher.Dispatcher]Dispatcher initialization failed

Tomcat启动报错: [org.apache.struts2.dispatcher.Dispatcher]Dispatcher initialization failed Unable to load configuration. - bean - jar:file:/E:/SoftwareDevelopment/Software/Eclipse4.3/eclipse-jee-kepler-SR1-win32-x86_64/Workspace/.metadata/.plugins/org.ec

Mybatis缓存报错org.apache.ibatis.exceptions.PersistenceException

错误信息如下: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.cache.CacheException: Error deserializing object. Cause: java.lang.ClassNotFoundException: com.kytsoft.model.Adminlink ### Cause: org.apa

用java运行Hadoop程序报错:org.apache.hadoop.fs.LocalFileSystem cannot be cast to org.apache.

用java运行Hadoop例程报错:org.apache.hadoop.fs.LocalFileSystem cannot be cast to org.apache.所写代码如下: package com.pcitc.hadoop; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.h

mavne install 报错org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException

maven install 报错 org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: nulljava.lang.reflect.InvocationTargetException at sun.reflect.

Vue热更新报错(log.error('[WDS] Errors while compiling. Reload prevented.'))

log.error('[WDS] Errors while compiling. Reload prevented.');中的WDS其实是webpack-dev-serverwebpack的意思,用来实现自动刷新的.但你在Vue组件进行频繁刷新时,如果没有安装Webpack,虽然页面可以正常显示,但是控制台会在你每次刷新时就报错.解决方法是:在开发目录下安装Webpack,命令为npm install webpack-dev-server --save-dev即可,安装完成之后会在node_mo

AS打包报错:Generate Signed APK: Errors while building APK. You can find the errors in the 'Messages' view.

在网上查阅相关资料找到解决办法如下: 找到app文件下的build.gradle文件,之后在该文件中的android加入如下代码即可: AS打包报错:Generate Signed APK: Errors while building APK. You can find the errors in the 'Messages' view. 原文地址:https://www.cnblogs.com/hwh000/p/10758645.html