@Override
        public void run() {
            // send message to server
            long sentCount = 0;
            int roundIndex = 0;
            int targetCnt = topicFilterTuples.size();
            while (msgCount < 0 || sentCount < msgCount) {
                // 1 Rotate to get the attribute information to be sent
                roundIndex = (int) (sentCount++ % targetCnt);
                Tuple2<String, String> target = topicFilterTuples.get(roundIndex);

                // 2 send message
                try {
                    // 2.1 Send data asynchronously, recommended
                    producer.sendMessage(MixedUtils.buildMessage(target.getF0(),
                            target.getF1(), bodyData, sentCount), new DefaultSendCallback());
                    // Or
                    // 2.2 Send message synchronous, not recommended
                    // MessageSentResult result = producer.sendMessage(message);
                    // totalSentCnt.incrementAndGet();
                    // if (!result.isSuccess()) {
                    // logger.error("Sync-send message failed!" + result.getErrMsg());
                    // }
                } catch (TubeClientException | InterruptedException e) {
                    logger.error("Send message failed!", e);
                }
                // 3 Cool sending
                // Attention: only used in the test link, to solve the problem of
                // frequent sending failures caused by insufficient test resources.
                MixedUtils.coolSending(sentCount);
            }
            try {
                producer.shutdown();
            } catch (Throwable e) {
                logger.error("producer shutdown error: ", e);
            }
            logger.info("The message sending task(" + indexId + ") has been completed!");
        }
Produce messages through multi-session factory instances.

@param args   Startup parameter array, including the following parts:
              The 1st parameter masterServers is the master address(es) to connect to,
                      format is master1_ip:port[,master2_ip:port];
              The 2nd parameter pubTopicAndFilterItems is the topic(s) (and filter condition set) to publish to,
                      format is topic_1[[:filterCond_1.1[;filterCond_1.2]][,topic_2]];
              The 3rd parameter msgCount is the message amount that needs to be sent;
              The 4th parameter pkgSize is the message's body size that needs to be sent;
              The 5th parameter clientCount is the amount of producer;
              The 6th parameter sessionFactoryCnt is the amount of session factory.
inlong-tubemq/tubemq-example/src/main/java/org/apache/inlong/tubemq/example/MAMessageProducerExample.java