请教大神,kafka使用时间戳获取offsets中,当时间戳是当前时间时,为什么获取到的offset是null?
请教大神,kafka使用时间戳获取offsets中,当时间戳是当前时间时,为什么获取到的offset是null?
使用的java api是:
Map<TopicPartition, Long> topicPartitionLongMap = new HashMap<>(); TopicPartition topicPartition = new TopicPartition(topic, partition); topicPartitionLongMap.put(topicPartition, timestamp); Map<TopicPartition, OffsetAndTimestamp> offsetMap = consumer.offsetsForTimes(topicPartitionLongMap);
return offsetMap.get(topicPartition).offset();
获取到的offsets是null
没有找到相关结果
已邀请:
1 个回复
空心菜 - 心向阳光,茁壮成长