use of com.jn.agileway.redis.core.serialization.RedisKeySerializer in project agileway by fangjinuo.
the class RedisTemplates method createRedisTemplate.
public static RedisTemplate<String, ?> createRedisTemplate(@NonNull RedisConnectionFactory connectionFactory, RedisTemplateProperties redisTemplateProperties, @Nullable ClassLoader beanClassLoader, @Nullable RedisLuaScriptRepository redisLuaScriptRepository, boolean initIt) {
RedisKeyWrapper keyWrapper = new RedisKeyWrapper(redisTemplateProperties.getKey());
RedisSerializer<String> keySerializer = new RedisKeySerializer(keyWrapper);
Codec<?> codec = newCodec(redisTemplateProperties.getValueCodecType());
RedisSerializer<?> valueSerializer = new DelegatableRedisSerializer(codec);
RedisSerializer hashKeySerializer = new RedisKeySerializer();
return createRedisTemplate(connectionFactory, keySerializer, valueSerializer, beanClassLoader, stringRedisSerializer, hashKeySerializer, valueSerializer, redisLuaScriptRepository, redisTemplateProperties.isTransactionEnabled(), initIt);
}
use of com.jn.agileway.redis.core.serialization.RedisKeySerializer in project agileway by fangjinuo.
the class RedisTemplates method createRedisTemplate.
public static RedisTemplate<String, ?> createRedisTemplate(@NonNull RedisConnectionFactory connectionFactory, @NonNull RedisKeyWrapper keyWrapper, @NonNull RedisSerializer<?> valueSerializer, @Nullable ClassLoader beanClassLoader, @Nullable RedisSerializer<String> stringSerializer, @Nullable RedisSerializer<?> hashKeySerializer, @Nullable RedisSerializer<?> hashValueSerializer, @Nullable RedisLuaScriptRepository redisLuaScriptRepository, boolean enableTx, boolean initIt) {
RedisKeySerializer redisKeySerializer = new RedisKeySerializer();
redisKeySerializer.setKeyWrapper(keyWrapper);
return createRedisTemplate(connectionFactory, redisKeySerializer, valueSerializer, beanClassLoader, stringSerializer, hashKeySerializer, hashValueSerializer, redisLuaScriptRepository, enableTx, initIt);
}
Aggregations