jedisConnFactory.setPort(SettingsUtils.getPort());
jedisConnFactory.setHostName(SettingsUtils.getHost());
jedisConnFactory.afterPropertiesSet();
RedisTemplate<String, String> genericTemplate = new StringRedisTemplate(jedisConnFactory);
RedisTemplate<String, String> xstreamGenericTemplate = new RedisTemplate<String, String>();
xstreamGenericTemplate.setConnectionFactory(jedisConnFactory);
xstreamGenericTemplate.setDefaultSerializer(serializer);
xstreamGenericTemplate.afterPropertiesSet();
RedisTemplate<String, Person> jsonPersonTemplate = new RedisTemplate<String, Person>();
jsonPersonTemplate.setConnectionFactory(jedisConnFactory);
jsonPersonTemplate.setDefaultSerializer(jsonSerializer);
jsonPersonTemplate.setHashKeySerializer(jsonSerializer);
jsonPersonTemplate.setHashValueSerializer(jsonStringSerializer);
jsonPersonTemplate.afterPropertiesSet();
RedisTemplate<String, Person> jackson2JsonPersonTemplate = new RedisTemplate<String, Person>();
jackson2JsonPersonTemplate.setConnectionFactory(jedisConnFactory);
jackson2JsonPersonTemplate.setDefaultSerializer(jackson2JsonSerializer);
jackson2JsonPersonTemplate.setHashKeySerializer(jackson2JsonSerializer);
jackson2JsonPersonTemplate.setHashValueSerializer(jackson2JsonStringSerializer);
jackson2JsonPersonTemplate.afterPropertiesSet();
// JRedis
JredisConnectionFactory jredisConnFactory = new JredisConnectionFactory(new JredisPool(SettingsUtils.getHost(),
SettingsUtils.getPort()));
jredisConnFactory.afterPropertiesSet();
RedisTemplate<String, String> genericTemplateJR = new StringRedisTemplate(jredisConnFactory);
RedisTemplate<String, Person> xGenericTemplateJR = new RedisTemplate<String, Person>();
xGenericTemplateJR.setConnectionFactory(jredisConnFactory);
xGenericTemplateJR.setDefaultSerializer(serializer);
xGenericTemplateJR.afterPropertiesSet();
RedisTemplate<String, Person> jsonPersonTemplateJR = new RedisTemplate<String, Person>();
jsonPersonTemplateJR.setConnectionFactory(jredisConnFactory);
jsonPersonTemplateJR.setDefaultSerializer(jsonSerializer);
jsonPersonTemplateJR.setHashKeySerializer(jsonSerializer);
jsonPersonTemplateJR.setHashValueSerializer(jsonStringSerializer);
jsonPersonTemplateJR.afterPropertiesSet();
RedisTemplate<String, Person> jackson2JsonPersonTemplateJR = new RedisTemplate<String, Person>();
jackson2JsonPersonTemplateJR.setConnectionFactory(jredisConnFactory);
jackson2JsonPersonTemplateJR.setDefaultSerializer(jackson2JsonSerializer);
jackson2JsonPersonTemplateJR.setHashKeySerializer(jackson2JsonSerializer);
jackson2JsonPersonTemplateJR.setHashValueSerializer(jackson2JsonStringSerializer);
jackson2JsonPersonTemplateJR.afterPropertiesSet();
// Lettuce
LettuceConnectionFactory lettuceConnFactory = new LettuceConnectionFactory();
lettuceConnFactory.setPort(SettingsUtils.getPort());
lettuceConnFactory.setHostName(SettingsUtils.getHost());
lettuceConnFactory.afterPropertiesSet();
RedisTemplate<String, String> genericTemplateLtc = new StringRedisTemplate(lettuceConnFactory);
RedisTemplate<String, Person> xGenericTemplateLtc = new RedisTemplate<String, Person>();
xGenericTemplateLtc.setConnectionFactory(lettuceConnFactory);
xGenericTemplateLtc.setDefaultSerializer(serializer);
xGenericTemplateLtc.afterPropertiesSet();
RedisTemplate<String, Person> jsonPersonTemplateLtc = new RedisTemplate<String, Person>();
jsonPersonTemplateLtc.setConnectionFactory(lettuceConnFactory);
jsonPersonTemplateLtc.setDefaultSerializer(jsonSerializer);
jsonPersonTemplateLtc.setHashKeySerializer(jsonSerializer);
jsonPersonTemplateLtc.setHashValueSerializer(jsonStringSerializer);
jsonPersonTemplateLtc.afterPropertiesSet();
RedisTemplate<String, Person> jackson2JsonPersonTemplateLtc = new RedisTemplate<String, Person>();
jackson2JsonPersonTemplateLtc.setConnectionFactory(lettuceConnFactory);
jackson2JsonPersonTemplateLtc.setDefaultSerializer(jackson2JsonSerializer);
jackson2JsonPersonTemplateLtc.setHashKeySerializer(jackson2JsonSerializer);
jackson2JsonPersonTemplateLtc.setHashValueSerializer(jackson2JsonStringSerializer);
jackson2JsonPersonTemplateLtc.afterPropertiesSet();
// SRP
SrpConnectionFactory srpConnFactory = new SrpConnectionFactory();
srpConnFactory.setPort(SettingsUtils.getPort());
srpConnFactory.setHostName(SettingsUtils.getHost());
srpConnFactory.afterPropertiesSet();
RedisTemplate<String, String> genericTemplateSrp = new StringRedisTemplate(srpConnFactory);
RedisTemplate<String, Person> xGenericTemplateSrp = new RedisTemplate<String, Person>();
xGenericTemplateSrp.setConnectionFactory(srpConnFactory);
xGenericTemplateSrp.setDefaultSerializer(serializer);
xGenericTemplateSrp.afterPropertiesSet();