public Set<String> publish(Set<String> topicSet) throws TubeClientException {
        checkServiceStatus();
        StringBuilder sBuilder = new StringBuilder(512);
        Set<String> failTopicSet = new HashSet<>();
        Set<String> successTopicSet = new HashSet<>();
        try {
            logger.info(sBuilder.append("[Publish begin 2] publish topicSet ")
                    .append(topicSet).append(", address = ")
                    .append(this.toString()).toString());
            sBuilder.delete(0, sBuilder.length());
            boolean hasNewTopic = false;
            for (String topicItem : topicSet) {
                AtomicInteger curPubCnt = this.publishTopics.get(topicItem);
                if (curPubCnt == null) {
                    AtomicInteger tmpPubCnt = new AtomicInteger(0);
                    curPubCnt = this.publishTopics.putIfAbsent(topicItem, tmpPubCnt);
                    if (curPubCnt == null) {
                        curPubCnt = tmpPubCnt;
                    }
                }
                if (curPubCnt.incrementAndGet() == 1) {
                    hasNewTopic = true;
                }
            }
            if (hasNewTopic) {
                long curTime = System.currentTimeMillis();
                new ProducerHeartbeatTask().run();
                logger.info(sBuilder
                        .append("[Publish begin 2] already get meta info, topicSet: ")
                        .append(topicSet).append(", waste time ")
                        .append(System.currentTimeMillis() - curTime).append(" Ms").toString());
                sBuilder.delete(0, sBuilder.length());
            }
            for (String topicItem : topicSet) {
                if (topicPartitionMap.containsKey(topicItem)) {
                    successTopicSet.add(topicItem);
                } else {
                    failTopicSet.add(topicItem);
                }
            }
            if (!failTopicSet.isEmpty()) {
                logger.info(sBuilder.append("Publish topic failure, make sure the topics ")
                        .append(failTopicSet).append(" exist or acceptPublish and try later!").toString());
                sBuilder.delete(0, sBuilder.length());
            }
        } finally {
            if (isStartHeart.compareAndSet(false, true)) {
                heartbeatService.scheduleWithFixedDelay(new ProducerHeartbeatTask(), 5L,
                        tubeClientConfig.getHeartbeatPeriodMs(), TimeUnit.MILLISECONDS);
            }
        }
        return successTopicSet;
    }
Publish a set of topic.

@param topicSet a set of topic names
@return a set of successful published topic names
@throws TubeClientException   the exception at publish
inlong-tubemq/tubemq-client/src/main/java/org/apache/inlong/tubemq/client/producer/ProducerManager.java