jedisConnFactory.setHostName(SettingsUtils.getHost());
jedisConnFactory.setDatabase(2);
jedisConnFactory.afterPropertiesSet();
RedisTemplate<String, String> stringTemplate = new StringRedisTemplate(jedisConnFactory);
RedisTemplate<String, Person> personTemplate = new RedisTemplate<String, Person>();
personTemplate.setConnectionFactory(jedisConnFactory);
personTemplate.afterPropertiesSet();
RedisTemplate<byte[], byte[]> rawTemplate = new RedisTemplate<byte[], byte[]>();
rawTemplate.setEnableDefaultSerializer(false);
rawTemplate.setConnectionFactory(jedisConnFactory);
rawTemplate.afterPropertiesSet();
// add Lettuce
LettuceConnectionFactory lettuceConnFactory = new LettuceConnectionFactory();
lettuceConnFactory.setPort(SettingsUtils.getPort());
lettuceConnFactory.setHostName(SettingsUtils.getHost());
lettuceConnFactory.afterPropertiesSet();
RedisTemplate<String, String> stringTemplateLtc = new StringRedisTemplate(lettuceConnFactory);
RedisTemplate<String, Person> personTemplateLtc = new RedisTemplate<String, Person>();
personTemplateLtc.setConnectionFactory(lettuceConnFactory);
personTemplateLtc.afterPropertiesSet();
RedisTemplate<byte[], byte[]> rawTemplateLtc = new RedisTemplate<byte[], byte[]>();
rawTemplateLtc.setEnableDefaultSerializer(false);
rawTemplateLtc.setConnectionFactory(lettuceConnFactory);
rawTemplateLtc.afterPropertiesSet();
// SRP
SrpConnectionFactory srpConnFactory = new SrpConnectionFactory();
srpConnFactory.setPort(SettingsUtils.getPort());
srpConnFactory.setHostName(SettingsUtils.getHost());
srpConnFactory.afterPropertiesSet();
RedisTemplate<String, String> stringTemplateSrp = new StringRedisTemplate(srpConnFactory);
RedisTemplate<String, Person> personTemplateSrp = new RedisTemplate<String, Person>();
personTemplateSrp.setConnectionFactory(srpConnFactory);
personTemplateSrp.afterPropertiesSet();
RedisTemplate<byte[], byte[]> rawTemplateSrp = new RedisTemplate<byte[], byte[]>();
rawTemplateSrp.setEnableDefaultSerializer(false);