集群同步-》同步消费位点
This commit is contained in:
@@ -106,4 +106,9 @@ public class ConsumerController {
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@GetMapping("/group/id/list")
|
||||
public Object getGroupIdList() {
|
||||
return consumerService.getGroupIdList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,4 +28,6 @@ public interface ConsumerService {
|
||||
ResponseData resetOffsetToEndpoint(String groupId, String topic, OffsetResetStrategy strategy);
|
||||
|
||||
ResponseData resetPartitionToTargetOffset(String groupId, TopicPartition partition, long offset);
|
||||
|
||||
ResponseData getGroupIdList();
|
||||
}
|
||||
|
||||
@@ -133,4 +133,9 @@ public class ConsumerServiceImpl implements ConsumerService {
|
||||
Tuple2<Object, String> tuple2 = consumerConsole.resetPartitionToTargetOffset(groupId, partition, offset);
|
||||
return (boolean) tuple2._1() ? ResponseData.create().success() : ResponseData.create().failed(tuple2._2());
|
||||
}
|
||||
|
||||
@Override public ResponseData getGroupIdList() {
|
||||
Set<String> stateGroup = consumerConsole.getConsumerGroupIdList(null);
|
||||
return ResponseData.create().data(stateGroup).success();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user