Example #1
0
 @Bean
 public JedisConnectionFactory redisConnectionFactory() {
   JedisConnectionFactory factory = new JedisConnectionFactory();
   factory.setHostName(host);
   factory.setPort(port);
   factory.setTimeout(timeout);
   return factory;
 }
 protected final JedisConnectionFactory applyProperties(JedisConnectionFactory factory) {
   factory.setHostName(this.properties.getHost());
   factory.setPort(this.properties.getPort());
   if (this.properties.getPassword() != null) {
     factory.setPassword(this.properties.getPassword());
   }
   factory.setDatabase(this.properties.getDatabase());
   if (this.properties.getTimeout() > 0) {
     factory.setTimeout(this.properties.getTimeout());
   }
   return factory;
 }