private MessageSentResult checkMessageAndStatus(final Message message) {
        if (message == null) {
            return new MessageSentResult(message, false,
                    TErrCodeConstants.PARAMETER_MSG_NULL, "Illegal parameter: null message package!");
        }
        if (TStringUtils.isBlank(message.getTopic())) {
            return new MessageSentResult(message, false,
                    TErrCodeConstants.PARAMETER_MSG_TOPIC_BLANK, "Illegal parameter: blank topic in message package!");
        }
        if ((message.getData() == null)
                || (message.getData().length == 0)) {
            return new MessageSentResult(message, false,
                    TErrCodeConstants.PARAMETER_MSG_BODY_EMPTY, "Illegal parameter: null data in message package!");
        }
        if (this.publishTopicMap.get(message.getTopic()) == null) {
            return new MessageSentResult(message, false,
                    TErrCodeConstants.PARAMETER_MSG_TOPIC_UNPUBLISHED,
                    new StringBuilder(512).append("Topic ").append(message.getTopic())
                            .append(" not publish, please publish first!").toString());
        }
        if (this.producerManager.getTopicPartition(message.getTopic()) == null) {
            return new MessageSentResult(message, false,
                    TErrCodeConstants.PARAMETER_MSG_TOPIC_NO_PARTITION,
                    new StringBuilder(512).append("Topic ").append(message.getTopic())
                            .append(" not publish, make sure the topic exist or acceptPublish and try later!")
                            .toString());
        }
        int msgSize = TStringUtils.isBlank(message.getAttribute())
                ? message.getData().length
                : (message.getData().length + message.getAttribute().length());
        if (msgSize > producerManager.getMaxMsgSize(message.getTopic())) {
            return new MessageSentResult(message, false,
                    TErrCodeConstants.PARAMETER_MSG_OVER_MAX_LENGTH,
                    new StringBuilder(512)
                            .append("Illegal parameter: over max message length for the total size of")
                            .append(" message data and attribute, allowed size is ")
                            .append(producerManager.getMaxMsgSize(message.getTopic()))
                            .append(", message's real size is ").append(msgSize).toString());
        }
        if (isShutDown.get()) {
            return new MessageSentResult(message, false,
                    TErrCodeConstants.CLIENT_SHUTDOWN, "Status error: producer has been shutdown!");
        }
        return new MessageSentResult(message, true, TErrCodeConstants.SUCCESS, "Ok");
    }
Check if the given topic accept publish message.

@param topic topic name
@return if accept message
@throws TubeClientException
inlong-tubemq/tubemq-client/src/main/java/org/apache/inlong/tubemq/client/producer/SimpleMessageProducer.java