@Override
    public boolean configBrokersForTopics(MasterEntry masterEntry,
            Set<String> topics, List<Integer> brokerList, int maxBrokers) {
        if (maxBrokers == 0) {
            return false;
        }
        List<Integer> finalBrokerList = brokerList.subList(0, maxBrokers);
        String brokerStr = StringUtils.join(finalBrokerList, ",");
        String topicStr = StringUtils.join(topics, ",");
        String url = TubeConst.SCHEMA + masterEntry.getIp() + ":" + masterEntry.getWebPort()
                + TubeConst.ADD_TUBE_TOPIC + TubeConst.TOPIC_NAME + topicStr + TubeConst.BROKER_ID + brokerStr
                + TubeConst.CONF_MOD_AUTH_TOKEN + masterEntry.getToken() + TubeConst.CREATE_USER + TubeConst.TUBEADMIN;
        HttpGet httpget = new HttpGet(url);
        log.info("config topics {} to brokers ids {}, masterEntry is : {}",
                topics, finalBrokerList, masterEntry.getIp());
        try (CloseableHttpResponse response = httpclient.execute(httpget)) {
            TubeHttpResponse result =
                    gson.fromJson(new InputStreamReader(response.getEntity().getContent(), StandardCharsets.UTF_8),
                            TubeHttpResponse.class);
            if (result.getErrCode() != TubeConst.SUCCESS_CODE) {
                log.error("config topics {} to brokers ids {} fail : master return with status {}",
                        topics, finalBrokerList, result.getErrMsg());
                return false;
            }
            return true;
        } catch (Exception ex) {
            log.error("exception caught while requesting broker status", ex);
        }
        return false;
    }
clone source broker to generate brokers with the same config and copy the topics in it.

@param req
@return

@throws Exception exception
inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/service/NodeServiceImpl.java