public static boolean checkConsumerTopicList(Set<String> depTopicSet,
            List<String> reqTopicLst, StringBuilder strBuff, ProcessResult result) {
        if ((reqTopicLst == null) || (reqTopicLst.isEmpty())) {
            result.setFailResult(TErrCodeConstants.BAD_REQUEST,
                    "Request miss necessary subscribed topicList data!");
            return result.isSuccess();
        }
        // remove spaces
        Set<String> transTopicSet = new HashSet<>();
        for (String topicItem : reqTopicLst) {
            if (TStringUtils.isBlank(topicItem)) {
                continue;
            }
            transTopicSet.add(topicItem.trim());
        }
        if (transTopicSet.isEmpty()) {
            result.setFailResult(TErrCodeConstants.BAD_REQUEST,
                    "Request subscribed topicList data must not Blank!");
            return result.isSuccess();
        }
        // check if exceed max topic count booked
        if (transTopicSet.size() > TBaseConstants.META_MAX_BOOKED_TOPIC_COUNT) {
            result.setFailResult(TErrCodeConstants.BAD_REQUEST,
                    strBuff.append("Subscribed topicList size over max value, required max count is ")
                            .append(TBaseConstants.META_MAX_BOOKED_TOPIC_COUNT).toString());
            strBuff.delete(0, strBuff.length());
            return result.isSuccess();
        }
        // Check if the topics all in deployment
        Set<String> invalidTopicSet = new HashSet<>();
        for (String reqTopic : transTopicSet) {
            if (!depTopicSet.contains(reqTopic)) {
                invalidTopicSet.add(reqTopic);
            }
        }
        if (!invalidTopicSet.isEmpty()) {
            result.setFailResult(TErrCodeConstants.TOPIC_NOT_DEPLOYED,
                    strBuff.append("Requested topic [").append(invalidTopicSet)
                            .append("] not deployed!").toString());
            strBuff.delete(0, strBuff.length());
            return result.isSuccess();
        }
        result.setSuccResult(transTopicSet);
        return result.isSuccess();
    }
Check request topic list of consumer

@param depTopicSet  the deployed topic set
@param reqTopicLst the topic list to be checked.
@param strBuff   a string buffer used to construct the result
@param result    process result
@return the check result
inlong-tubemq/tubemq-server/src/main/java/org/apache/inlong/tubemq/server/common/paramcheck/PBParameterUtils.java