@Override
    protected Object convertToInternal(Object payload, MessageHeaders headers, Object conversionHint) {
        // encode payload to json string or byte[]
        Object obj;
        if (byte[].class == getSerializedPayloadClass()) {
            if (payload instanceof String && JSON.isValid((String) payload)) {
                obj = ((String) payload).getBytes(fastJsonConfig.getCharset());
            } else {
                obj = JSON.toJSONBytes(payload, fastJsonConfig.getSerializeFilters(), fastJsonConfig.getSerializerFeatures());
            }
        } else {
            if (payload instanceof String && JSON.isValid((String) payload)) {
                obj = payload;
            } else {
                obj = JSON.toJSONString(payload, fastJsonConfig.getSerializeFilters(), fastJsonConfig.getSerializerFeatures());
            }
        }

        return obj;
    }
@param fastJsonConfig the fastJsonConfig to set.
fastjson1-compatible/src/main/java/com/alibaba/fastjson/support/spring/messaging/MappingFastJsonMessageConverter.java