@Override
    public TubeMQResult rebalanceGroup(RebalanceGroupReq req) {

        MasterEntry master = masterService.getMasterNode(Long.valueOf(req.getClusterId()));
        if (master == null) {
            return TubeMQResult.errorResult("no such cluster");
        }

        // 1. get all consumer ids in group
        List<String> consumerIds = Objects
                .requireNonNull(requestGroupRunInfo(master, req.getGroupName())).getConsumerIds();
        RebalanceGroupResult rebalanceGroupResult = new RebalanceGroupResult();

        // 2. rebalance consumers in group
        consumerIds.forEach(consumerId -> {
            RebalanceConsumerReq rebalanceConsumerReq = ConvertUtils.convertToRebalanceConsumerReq(req,
                    consumerId);
            String url = TubeConst.SCHEMA + master.getIp() + ":" + master.getWebPort()
                    + "/" + TubeConst.TUBE_REQUEST_PATH + "?" + ConvertUtils
                            .convertReqToQueryStr(rebalanceConsumerReq);
            TubeMQResult result = masterService.requestMaster(url);
            if (result.getErrCode() != 0) {
                rebalanceGroupResult.getFailConsumers().add(consumerId);
            }
            rebalanceGroupResult.getSuccessConsumers().add(consumerId);
        });

        TubeMQResult tubeResult = new TubeMQResult();
        tubeResult.setData(gson.toJson(rebalanceGroupResult));
        return tubeResult;
    }
Validates if the provided URL string is in a valid URL format.

@param url The URL string to be validated.
@return True if the URL is in a valid format, otherwise false.
inlong-tubemq/tubemq-manager/src/main/java/org/apache/inlong/tubemq/manager/service/TopicServiceImpl.java