public static List<Message> convertMessage(final String topicName,
            List<ClientBroker.TransferedMessage> transferedMessageList) {
        if (transferedMessageList == null || transferedMessageList.isEmpty()) {
            return new ArrayList<>();
        }
        List<Message> messageList = new ArrayList<>(transferedMessageList.size());
        for (ClientBroker.TransferedMessage trsMessage : transferedMessageList) {
            final int flag = trsMessage.getFlag();
            int dataCheckSum = trsMessage.getCheckSum();
            final ByteBuffer payloadData = ByteBuffer.allocate(trsMessage.getPayLoadData().size());
            payloadData.put(trsMessage.getPayLoadData().toByteArray());
            payloadData.flip();
            int payloadDataLen = payloadData.array().length;
            int currentChecksum = CheckSum.crc32(payloadData.array());
            if (dataCheckSum != currentChecksum) {
                continue;
            }
            int readPos = 0;
            String attribute = null;
            if (MessageFlagUtils.hasAttribute(flag)) {
                if (payloadDataLen < 4) {
                    continue;
                }
                final int attrLen = payloadData.getInt(0);
                payloadDataLen -= 4;
                readPos += 4;
                if (attrLen > payloadDataLen) {
                    continue;
                }
                if (attrLen > 0) {
                    final byte[] attrData = new byte[attrLen];
                    System.arraycopy(payloadData.array(), readPos, attrData, 0, attrLen);
                    try {
                        attribute = new String(attrData, TBaseConstants.META_DEFAULT_CHARSET_NAME);
                    } catch (final UnsupportedEncodingException e) {
                        throw new RuntimeException(e);
                    }
                    readPos += attrLen;
                    payloadDataLen -= attrLen;
                }
            }
            final byte[] payload = new byte[payloadDataLen];
            System.arraycopy(payloadData.array(), readPos, payload, 0, payloadDataLen);
            messageList.add(new MessageExt(trsMessage.getMessageId(), topicName, payload, attribute, flag));
        }
        return messageList;
    }
convert a list of @link ClientBroker.TransferedMessage with topicName
to a list of @link Message

@param topicName
@param transferedMessageList return a list of @link Message
inlong-tubemq/tubemq-core/src/main/java/org/apache/inlong/tubemq/corebase/utils/DataConverterUtil.java