@Override
    public RegisterResponseM2P producerRegisterP2M(RegisterRequestP2M request,
            final String rmtAddress,
            boolean overtls) throws Exception {
        ProcessResult result = new ProcessResult();
        final StringBuilder strBuff = new StringBuilder(512);
        RegisterResponseM2P.Builder builder = RegisterResponseM2P.newBuilder();
        builder.setSuccess(false);
        builder.setBrokerCheckSum(-1);
        if (!serverAuthHandler.identityValidUserInfo(request.getAuthInfo(), true, result)) {
            builder.setErrCode(result.getErrCode());
            builder.setErrMsg(result.getErrMsg());
            return builder.build();
        }
        final CertifiedInfo certifiedInfo = (CertifiedInfo) result.getRetData();
        if (!PBParameterUtils.checkClientId(request.getClientId(), strBuff, result)) {
            builder.setErrCode(result.getErrCode());
            builder.setErrMsg(result.getErrMsg());
            return builder.build();
        }
        final String producerId = (String) result.getRetData();
        if (!PBParameterUtils.checkHostName(request.getHostName(), strBuff, result)) {
            builder.setErrCode(result.getErrCode());
            builder.setErrMsg(result.getErrMsg());
            return builder.build();
        }
        final String hostName = (String) result.getRetData();
        if (!PBParameterUtils.checkProducerTopicList(request.getTopicListList(), strBuff, result)) {
            builder.setErrCode(result.getErrCode());
            builder.setErrMsg(result.getErrMsg());
            return builder.build();
        }
        final Set<String> transTopicSet = (Set<String>) result.getRetData();
        if (!request.hasBrokerCheckSum()) {
            builder.setErrCode(TErrCodeConstants.BAD_REQUEST);
            builder.setErrMsg("Request miss necessary brokerCheckSum field!");
            return builder.build();
        }
        checkNodeStatus(producerId, strBuff);
        if (!serverAuthHandler.validProducerAuthorizeInfo(
                certifiedInfo.getUserName(), transTopicSet, rmtAddress, result)) {
            builder.setErrCode(result.getErrCode());
            builder.setErrMsg(result.getErrMsg());
            return builder.build();
        }
        final String clientJdkVer = request.hasJdkVersion() ? request.getJdkVersion() : "";
        heartbeatManager.regProducerNode(producerId);
        producerHolder.setProducerInfo(producerId,
                new HashSet<>(transTopicSet), hostName, overtls);
        // get current configure information
        Tuple2<Long, Map<Integer, String>> brokerStaticInfo =
                brokerRunManager.getBrokerStaticInfo(overtls);
        Tuple3<Long, Integer, Map<String, String>> prodTopicConfigTuple =
                getTopicConfigureInfos(producerId, true);
        builder.setBrokerCheckSum(brokerStaticInfo.getF0());
        builder.addAllBrokerInfos(brokerStaticInfo.getF1().values());
        builder.setAuthorizedInfo(genAuthorizedInfo(
                certifiedInfo.getAuthorizedToken(), false).build());
        ClientMaster.ApprovedClientConfig.Builder clientConfigBuilder =
                buildApprovedClientConfig(request.getAppdConfig(), prodTopicConfigTuple);
        if (clientConfigBuilder != null) {
            builder.setAppdConfig(clientConfigBuilder);
        }
        logger.info(strBuff.append("[Producer Register] ").append(producerId)
                .append(", isOverTLS=").append(overtls)
                .append(", clientJDKVer=").append(clientJdkVer).toString());
        builder.setSuccess(true);
        builder.setErrCode(TErrCodeConstants.SUCCESS);
        builder.setErrMsg("OK!");
        return builder.build();
    }
Producer register request to master

@param request
@param rmtAddress
@param overtls
@return register response
@throws Exception
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/master/TMaster.java