public void adminQueryBookedGroup(HttpServletRequest req,
            StringBuilder sBuffer) {
        // get divide info
        ProcessResult result = new ProcessResult();
        if (!WebParameterUtils.getBooleanParamValue(req,
                WebFieldDef.WITHDIVIDE, false, false, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return;
        }
        boolean withDivide = (boolean) result.getRetData();
        // get offset service
        int itemCnt = 0;
        int totalCnt = 0;
        OffsetService offsetService = broker.getOffsetManager();
        sBuffer.append("{\"result\":true,\"errCode\":0,\"errMsg\":\"Success!\",\"dataSet\":[");
        if (withDivide) {
            // query online group name set
            Set<String> onlineGroups = offsetService.getOnlineGroups();
            sBuffer.append("{\"type\":\"online\",\"groupName\":[");
            for (String group : onlineGroups) {
                if (itemCnt++ > 0) {
                    sBuffer.append(",");
                }
                sBuffer.append("\"").append(group).append("\"");
            }
            sBuffer.append("],\"groupCount\":").append(itemCnt).append("}");
            totalCnt++;
            sBuffer.append(",");
            // query offline group name set
            itemCnt = 0;
            Set<String> offlineGroups = offsetService.getOfflineGroups();
            sBuffer.append("{\"type\":\"offline\",\"groupName\":[");
            for (String group : offlineGroups) {
                if (itemCnt++ > 0) {
                    sBuffer.append(",");
                }
                sBuffer.append("\"").append(group).append("\"");
            }
            sBuffer.append("],\"groupCount\":").append(itemCnt).append("}");
            totalCnt++;
        } else {
            Set<String> allGroups = offsetService.getAllBookedGroups();
            sBuffer.append("{\"type\":\"all\",\"groupName\":[");
            for (String group : allGroups) {
                if (itemCnt++ > 0) {
                    sBuffer.append(",");
                }
                sBuffer.append("\"").append(group).append("\"");
            }
            sBuffer.append("],\"groupCount\":").append(itemCnt).append("}");
            totalCnt++;
        }
        sBuffer.append("],\"dataCount\":").append(totalCnt).append("}");
    }
Query all consumer groups booked on the Broker.

@param req      request
@param sBuffer  process result
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/broker/web/BrokerAdminServlet.java