private boolean tryRegister2Master(ProcessResult result, StringBuilder sBuffer) {
        try {
            ClientMaster.RegisterResponseM2CV2 response =
                    masterService.consumerRegisterC2MV2(createMasterRegisterRequest(),
                            AddressUtils.getLocalAddress(), consumerConfig.isTlsEnable());
            if (response == null) {
                clientStatsInfo.bookReg2Master(true);
                result.setFailResult(TErrCodeConstants.CONNECT_RETURN_NULL,
                        sBuffer.append("Register Failed: ").append(consumerId)
                                .append(" register to master return null!").toString());
                sBuffer.delete(0, sBuffer.length());
                return result.isSuccess();
            }
            if (response.getErrCode() != TErrCodeConstants.SUCCESS) {
                clientStatsInfo.bookReg2Master(true);
                // If the consumer group is forbidden, output the log
                if (response.getErrCode() == TErrCodeConstants.CONSUME_GROUP_FORBIDDEN) {
                    result.setFailResult(response.getErrCode(),
                            sBuffer.append("Register Failed: ").append(consumerId)
                                    .append("'s ConsumeGroup forbidden, ")
                                    .append(response.getErrMsg()).toString());
                } else {
                    result.setFailResult(response.getErrCode(),
                            sBuffer.append("Register Failed: ").append(consumerId)
                                    .append(" ").append(response.getErrMsg()).toString());
                }
                sBuffer.delete(0, sBuffer.length());
                return result.isSuccess();
            }
            clientStatsInfo.bookReg2Master(false);
            // Process the successful response
            clientRmtDataCache.updateReg2MasterTime();
            clientRmtDataCache.updateBrokerInfoList(response.getBrokerConfigId(),
                    response.getBrokerConfigListList(), sBuffer);
            clientRmtDataCache.updOpsTaskInfo(response.getOpsTaskInfo(), sBuffer);
            processRegAuthorizedToken(response);
            result.setSuccResult();
            return result.isSuccess();
        } catch (Throwable e) {
            result.setFailResult(sBuffer.append("Register Failed: register to master throw ")
                    .append(e.getCause()).toString());
            sBuffer.delete(0, sBuffer.length());
            return result.isSuccess();
        }
    }
Start heartbeat thread threads.

@param result  process result
@param sBuffer  string buffer

@return  process result
inlong-tubemq/tubemq-client/src/main/java/org/apache/inlong/tubemq/client/consumer/SimpleClientBalanceConsumer.java