gpt4 book ai didi

java - Kafka 获取偏移量数据时出错。原因 : 1

转载 作者:行者123 更新时间:2023-11-30 08:11:34 25 4
gpt4 key购买 nike

我正在运行一个使用 kafka 库的 java 程序,并每 1 秒从 zookeeper 检查一次消费者组的提交偏移量。程序运行良好约 2 小时并开始抛出 RuntimeException:

java.lang.RuntimeException: Error fetching offset data. Reason: 1
at com.pinterest.secor.common.KafkaClient.getMessage(KafkaClient.java:127)
at com.pinterest.secor.common.KafkaClient.getCommittedMessage(KafkaClient.java:186)

...

原因 1 是什么?我找不到任何说明这种情况的根本原因的文档或页面。

最佳答案

检查一下,这是kafka.common.ErrorMapping的一段代码:

  val UnknownCode : Short = -1
val NoError : Short = 0
val OffsetOutOfRangeCode : Short = 1
val InvalidMessageCode : Short = 2
val UnknownTopicOrPartitionCode : Short = 3
val InvalidFetchSizeCode : Short = 4
val LeaderNotAvailableCode : Short = 5
val NotLeaderForPartitionCode : Short = 6
val RequestTimedOutCode: Short = 7
val BrokerNotAvailableCode: Short = 8
val ReplicaNotAvailableCode: Short = 9
val MessageSizeTooLargeCode: Short = 10
val StaleControllerEpochCode: Short = 11
val OffsetMetadataTooLargeCode: Short = 12
val StaleLeaderEpochCode: Short = 13
val OffsetsLoadInProgressCode: Short = 14
val ConsumerCoordinatorNotAvailableCode: Short = 15
val NotCoordinatorForConsumerCode: Short = 16
val InvalidTopicCode : Short = 17
val MessageSetSizeTooLargeCode: Short = 18
val NotEnoughReplicasCode : Short = 19
val NotEnoughReplicasAfterAppendCode: Short = 20

如您所见,1 表示OffsetOutOfRangeCode

关于java - Kafka 获取偏移量数据时出错。原因 : 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30929712/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com