集群同步-》同步消费位点

This commit is contained in:
许晓东
2021-10-25 00:10:08 +08:00
parent 66e7ea0676
commit 5ccf9013e5
13 changed files with 233 additions and 6 deletions

View File

@@ -111,4 +111,9 @@ public class ConsumerController {
public Object getGroupIdList() {
return consumerService.getGroupIdList();
}
@GetMapping("/topic/list")
public Object getSubscribeTopicList(@RequestParam String groupId) {
return consumerService.getSubscribeTopicList(groupId);
}
}

View File

@@ -0,0 +1,30 @@
package com.xuxd.kafka.console.controller;
import com.xuxd.kafka.console.beans.dto.SyncDataDTO;
import com.xuxd.kafka.console.service.OperationService;
import org.apache.kafka.clients.admin.AdminClientConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* kafka-console-ui.
*
* @author xuxd
* @date 2021-10-24 23:13:28
**/
@RestController
@RequestMapping("/op")
public class OperationController {
@Autowired
private OperationService operationService;
@PostMapping("/sync/consumer/offset")
public Object syncConsumerOffset(@RequestBody SyncDataDTO dto) {
dto.getProperties().put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, dto.getAddress());
return operationService.syncConsumerOffset(dto.getGroupId(), dto.getTopic(), dto.getProperties());
}
}