@Override
    public byte[] serialize(T t) throws SerializationException {
        if (t == null) {
            return new byte[0];
        }
        try {
            if (config.isJSONB()) {
                return JSONB.toBytes(t, config.getSymbolTable(), config.getWriterFilters(), config.getWriterFeatures());
            } else {
                return JSON.toJSONBytes(t, config.getDateFormat(), config.getWriterFilters(), config.getWriterFeatures());
            }
        } catch (Exception ex) {
            throw new SerializationException("Could not serialize: " + ex.getMessage(), ex);
        }
    }
Fastjson for Spring Data Redis Serializer.

@author lihengming
@author Victor.Zxy
@see RedisSerializer
@since 2.0.2
extension-spring5/src/main/java/com/alibaba/fastjson2/support/spring/data/redis/FastJsonRedisSerializer.java