[Bugfix]修复查看消息时,选择分区不生效问题(#858)

This commit is contained in:
zengqiao
2023-01-09 11:18:11 +08:00
committed by EricZeng
parent 6b3eb05735
commit 2925a20e8e

View File

@@ -266,9 +266,14 @@ public class PartitionServiceImpl extends BaseKafkaVersionControlService impleme
List<TopicPartition> tpList = this.listPartitionFromCacheFirst(clusterPhyId, topicName).stream()
.filter(item -> !item.getLeaderBrokerId().equals(KafkaConstant.NO_LEADER))
.filter(partition -> partition.getPartitionId().equals(partitionId))
.map(elem -> new TopicPartition(topicName, elem.getPartitionId()))
.collect(Collectors.toList());
if (ValidateUtils.isEmptyList(tpList)) {
return Result.buildSuc(new HashMap<>(0));
}
try {
Result<List<Tuple<KSOffsetSpec, Map<TopicPartition, Long>>>> listResult =
(Result<List<Tuple<KSOffsetSpec, Map<TopicPartition, Long>>>>) doVCHandler(clusterPhyId, PARTITION_OFFSET_GET, new PartitionOffsetParam(clusterPhyId, topicName, offsetSpec, tpList));