kafka获取偏移量数据时出错原因:1

vdgimpew  于 2021-06-08  发布在  Kafka
关注(0)|答案(1)|浏览(472)

我正在运行一个java程序,它使用kafka库,每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是什么?我找不到任何文件或页面说明这种情况的根本原因。

b5buobof

b5buobof1#

看看这个,这是 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 .

相关问题