public static boolean getTopicNamePartIdInfo(boolean isProduce,
            String topicName, int partitionId,
            MetadataManager metadataManager,
            StringBuilder strBuffer,
            ProcessResult result) {
        // Check and get topic name
        if (!getStringParameter(WebFieldDef.TOPICNAME,
                topicName, strBuffer, result)) {
            return result.isSuccess();
        }
        String tgtTopicName = (String) result.getRetData();
        // Check if it is an allowed calling relationship
        if (isProduce) {
            if (tgtTopicName.equals(TServerConstants.OFFSET_HISTORY_NAME)) {
                result.setFailResult(TErrCodeConstants.FORBIDDEN,
                        strBuffer.append(WebFieldDef.TOPICNAME.name)
                                .append(" ").append(tgtTopicName)
                                .append(" does not allow producers to send data!").toString());
                strBuffer.delete(0, strBuffer.length());
                return result.isSuccess();
            }
        }
        TopicMetadata topicMetadata = metadataManager.getTopicMetadata(tgtTopicName);
        if (topicMetadata == null) {
            result.setFailResult(TErrCodeConstants.FORBIDDEN,
                    strBuffer.append(WebFieldDef.TOPICNAME.name)
                            .append(" ").append(tgtTopicName)
                            .append(" not existed, please check your configure").toString());
            strBuffer.delete(0, strBuffer.length());
            return result.isSuccess();
        }
        if (metadataManager.isClosedTopic(tgtTopicName)) {
            result.setFailResult(TErrCodeConstants.FORBIDDEN,
                    strBuffer.append(WebFieldDef.TOPICNAME.name)
                            .append(" ").append(tgtTopicName)
                            .append(" has been closed").toString());
            strBuffer.delete(0, strBuffer.length());
            return result.isSuccess();
        }
        int realPartition = partitionId < TBaseConstants.META_STORE_INS_BASE
                ? partitionId
                : partitionId % TBaseConstants.META_STORE_INS_BASE;
        if ((realPartition < 0) || (realPartition >= topicMetadata.getNumPartitions())) {
            result.setFailResult(TErrCodeConstants.FORBIDDEN,
                    strBuffer.append(WebFieldDef.PARTITIONID.name)
                            .append(" ").append(tgtTopicName).append("-").append(partitionId)
                            .append(" not existed, please check your configure").toString());
            strBuffer.delete(0, strBuffer.length());
            return result.isSuccess();
        }
        result.setSuccResult(topicMetadata);
        return result.isSuccess();
    }
Check the existing topic name info

@param isProduce      whether to call on the production side
@param topicName      the topic name to be checked.
@param partitionId    the partition ID where the topic locates
@param metadataManager the metadata manager which contains topic information
@param strBuffer      the string buffer used to construct the check result
@param result         the checked result
@return the check result
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/common/paramcheck/PBParameterUtils.java