@SuppressWarnings("unchecked")
    private <T> T doConvertMessage(MessageExt messageExt, Class<T> messageType) {
        if (Objects.equals(messageType, MessageExt.class)) {
            return (T) messageExt;
        } else {
            String str = new String(messageExt.getBody(), Charset.forName(charset));
            if (Objects.equals(messageType, String.class)) {
                return (T) str;
            } else {
                // If msgType not string, use objectMapper change it.
                try {
                    return (T) this.getMessageConverter().fromMessage(MessageBuilder.withPayload(str).build(), messageType);
                } catch (Exception e) {
                    log.info("convert failed. str:{}, msgType:{}", str, messageType);
                    throw new RuntimeException("cannot convert message to " + messageType, e);
                }
            }
        }
    }
Same to {@link #receive(Class<T>)} with receive timeout specified in addition.

@param clazz   message object type
@param timeout receive timeout with millis
@param <T>
@return message list
rocketmq-spring-boot/src/main/java/org/apache/rocketmq/spring/core/RocketMQTemplate.java