| | |
| | | import org.dromara.common.core.utils.SpringUtils; |
| | | import org.dromara.common.redis.config.properties.RedissonProperties; |
| | | import org.dromara.common.redis.handler.KeyPrefixHandler; |
| | | import org.dromara.common.redis.handler.RedisExceptionHandler; |
| | | import org.redisson.client.codec.StringCodec; |
| | | import org.redisson.codec.CompositeCodec; |
| | | import org.redisson.codec.TypedJsonJacksonCodec; |
| | |
| | | om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
| | | // 指定序列化输入的类型,类必须是非final修饰的。序列化时将对象全类名一起保存下来 |
| | | om.activateDefaultTyping(LaissezFaireSubTypeValidator.instance, ObjectMapper.DefaultTyping.NON_FINAL); |
| | | // LoggerFactory.useSlf4jLogging(true); |
| | | // FuryCodec furyCodec = new FuryCodec(); |
| | | // CompositeCodec codec = new CompositeCodec(StringCodec.INSTANCE, furyCodec, furyCodec); |
| | | TypedJsonJacksonCodec jsonCodec = new TypedJsonJacksonCodec(Object.class, om); |
| | | // 组合序列化 key 使用 String 内容使用通用 json 格式 |
| | | CompositeCodec codec = new CompositeCodec(StringCodec.INSTANCE, jsonCodec, jsonCodec); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 异常处理器 |
| | | */ |
| | | @Bean |
| | | public RedisExceptionHandler redisExceptionHandler() { |
| | | return new RedisExceptionHandler(); |
| | | } |
| | | |
| | | /** |
| | | * redis集群配置 yml |
| | | * |
| | | * --- # redis 集群配置(单机与集群只能开启一个另一个需要注释掉) |