public StringBuilder adminQuerySimpleBrokerId(HttpServletRequest req,
            StringBuilder sBuffer,
            ProcessResult result) {
        if (!WebParameterUtils.getStringParamValue(req,
                WebFieldDef.COMPSTOPICNAME, false, null, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        Set<String> topicNameSet = (Set<String>) result.getRetData();
        if (!WebParameterUtils.getBooleanParamValue(req,
                WebFieldDef.WITHIP, false, false, sBuffer, result)) {
            WebParameterUtils.buildFailResult(sBuffer, result.getErrMsg());
            return sBuffer;
        }
        boolean withIp = (Boolean) result.getRetData();
        Map<String, Map<Integer, String>> topicBrokerConfigMap =
                defMetaDataService.getTopicBrokerConfigInfo(topicNameSet);
        // build query result
        int dataCount = 0;
        WebParameterUtils.buildSuccessWithDataRetBegin(sBuffer);
        for (Map.Entry<String, Map<Integer, String>> entry : topicBrokerConfigMap.entrySet()) {
            if (dataCount++ > 0) {
                sBuffer.append(",");
            }
            sBuffer.append("{\"topicName\":\"").append(entry.getKey()).append("\",\"brokerInfo\":[");
            int topicCnt = 0;
            Map<Integer, String> brokerMap = entry.getValue();
            if (withIp) {
                for (Map.Entry<Integer, String> entry1 : brokerMap.entrySet()) {
                    if (topicCnt++ > 0) {
                        sBuffer.append(",");
                    }
                    sBuffer.append("{\"brokerId\":").append(entry1.getKey())
                            .append(",\"brokerIp\":\"").append(entry1.getValue()).append("\"}");
                }
            } else {
                for (Map.Entry<Integer, String> entry1 : brokerMap.entrySet()) {
                    if (topicCnt++ > 0) {
                        sBuffer.append(",");
                    }
                    sBuffer.append(entry1.getKey());
                }
            }
            sBuffer.append("],\"brokerCnt\":").append(topicCnt).append("}");
        }
        WebParameterUtils.buildSuccessWithDataRetEnd(sBuffer, dataCount);
        return sBuffer;
    }
Query topic's broker id set

@param req       Http Servlet Request
@param sBuffer   string buffer
@param result    process result
@return    process result
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/master/web/handler/WebTopicDeployHandler.java