简体   繁体   English

Kafka 流聚合 RecordTooLargeException

[英]Kafka streams aggregation RecordTooLargeException

Trying to aggregate data from a single stream with tumbling windows of 5 minutes.尝试聚合来自单个 stream 的数据,其中 windows 的翻滚时间为 5 分钟。 Initially it was working fine and was able to print aggregated records.最初它工作正常并且能够打印汇总记录。 Using Java 8 for development.使用 Java 8 进行开发。

But later started receiving an error -但后来开始收到错误 -

"org.apache.kafka.common.errors.RecordTooLargeException: The message is 5292482 bytes when serialized which is larger than 1048576, which is the value of the max.request.size configuration" “org.apache.kafka.common.errors.RecordTooLargeException:消息序列化时为5292482字节,大于1048576,即max.request.size配置的值”

AND now every time, after starting my app in EKS cluster, crashes within a minute, with the same error.现在,每次在 EKS 集群中启动我的应用程序后,都会在一分钟内崩溃,并出现相同的错误。

Tried to set following streamconfigs but they also not helped: StreamsConfig.RECEIVE_BUFFER_CONFIG (50 MB) StreamsConfig.CACHE_MAX_BYTES_BUFFERING_CONFIG (50 MB)尝试设置以下流配置,但它们也没有帮助:StreamsConfig.RECEIVE_BUFFER_CONFIG (50 MB) StreamsConfig.CACHE_MAX_BYTES_BUFFERING_CONFIG (50 MB)

Can anyone of the following will resolve this issue:以下任何人都可以解决此问题:

  1. Using inMemoryKeyValueStore.使用 inMemoryKeyValueStore。 is there any specific property to allocate some memory for inMemoryKeyValueStore?是否有任何特定属性可以为 inMemoryKeyValueStore 分配一些 memory?
  2. OR should switch to persistentKeyValueStore?或者应该切换到persistentKeyValueStore?
  3. Using AWS MSK so while creating cluster, define broker and topic level setting - message.max.bytes with appropriate value.在创建集群时使用 AWS MSK,定义代理和主题级别设置 - 具有适当值的 message.max.bytes。

Thanks in advance.提前致谢。

It's the producer config max.request.size (as mentioned in the error message) that you need to increase to address the issue.您需要增加生产者配置max.request.size (如错误消息中所述)以解决该问题。

Note that you might need to increase the broker/topic config message.max.bytes that you mentioned in addition.请注意,您可能需要增加您另外提到的代理/主题配置message.max.bytes

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM