@Override
    protected Object convertToInternal(Object payload, MessageHeaders headers, Object conversionHint) {
        // encode payload to json string or byte[]
        Object obj = null;

        if (byte[].class == getSerializedPayloadClass()) {
            if (payload instanceof String && config.isJSONB()) {
                obj = JSONB.fromJSONString((String) payload);
            } else if (payload instanceof String && !config.isJSONB()) {
                obj = ((String) payload).getBytes(config.getCharset());
            } else if (config.isJSONB()) {
                obj = JSONB.toBytes(payload, config.getSymbolTable(), config.getWriterFilters(), config.getWriterFeatures());
            } else {
                obj = JSON.toJSONBytes(payload, config.getDateFormat(), config.getWriterFilters(), config.getWriterFeatures());
            }
        } else if (String.class == getSerializedPayloadClass()) {
            if (payload instanceof String && JSON.isValid((String) payload)) {
                obj = payload;
            } else {
                obj = JSON.toJSONString(payload, config.getDateFormat(), config.getWriterFilters(), config.getWriterFeatures());
            }
        }
        return obj;
    }
@param fastJsonConfig the fastJsonConfig to set.
extension-spring6/src/main/java/com/alibaba/fastjson2/support/spring6/messaging/converter/MappingFastJsonMessageConverter.java