@Override
    public MessageSentResult sendMessage(final Message message)
            throws TubeClientException, InterruptedException {
        MessageSentResult result = checkMessageAndStatus(message);
        if (!result.isSuccess()) {
            return result;
        }
        Partition partition = this.selectPartition(message, BrokerWriteService.class);
        int brokerId = partition.getBrokerId();
        long startTime = System.currentTimeMillis();
        try {
            this.brokerRcvQltyStats.addSendStatistic(brokerId);
            ClientBroker.SendMessageResponseB2P response =
                    getBrokerService(partition.getBroker()).sendMessageP2B(
                            createSendMessageRequest(partition, message),
                            AddressUtils.getLocalAddress(), producerConfig.isTlsEnable());
            rpcServiceFactory.resetRmtAddrErrCount(partition.getBroker().getBrokerAddr());
            this.brokerRcvQltyStats.addReceiveStatistic(brokerId, response.getSuccess());
            if (!response.getSuccess()
                    && response.getErrCode() == TErrCodeConstants.SERVICE_UNAVAILABLE) {
                rpcServiceFactory.addUnavailableBroker(brokerId);
            }
            return this.buildMsgSentResult(
                    System.currentTimeMillis() - startTime, message, partition, response);
        } catch (final Throwable e) {
            if (e instanceof LocalConnException) {
                rpcServiceFactory.addRmtAddrErrCount(partition.getBroker().getBrokerAddr());
            }
            producerManager.getClientMetrics().bookFailRpcCall(
                    TErrCodeConstants.UNSPECIFIED_ABNORMAL);
            partition.increRetries(1);
            this.brokerRcvQltyStats.addReceiveStatistic(brokerId, false);
            throw new TubeClientException("Send message failed", e);
        }
    }
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