|
|
@ -42,6 +42,7 @@ import redis.clients.jedis.JedisPoolConfig;
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author Dave Syer
|
|
|
|
* @author Dave Syer
|
|
|
|
* @author Andy Wilkinson
|
|
|
|
* @author Andy Wilkinson
|
|
|
|
|
|
|
|
* @author Christian Dupuis
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
|
@ConditionalOnClass({ JedisConnection.class, RedisOperations.class, Jedis.class })
|
|
|
|
@ConditionalOnClass({ JedisConnection.class, RedisOperations.class, Jedis.class })
|
|
|
@ -79,12 +80,13 @@ public class RedisAutoConfiguration {
|
|
|
|
@Bean
|
|
|
|
@Bean
|
|
|
|
@ConditionalOnMissingBean
|
|
|
|
@ConditionalOnMissingBean
|
|
|
|
RedisConnectionFactory redisConnectionFactory() throws UnknownHostException {
|
|
|
|
RedisConnectionFactory redisConnectionFactory() throws UnknownHostException {
|
|
|
|
if (this.properties.getPool() != null) {
|
|
|
|
JedisConnectionFactory factory = null;
|
|
|
|
JedisConnectionFactory factory = new JedisConnectionFactory(
|
|
|
|
if (this.properties.getPool() == null) {
|
|
|
|
jedisPoolConfig());
|
|
|
|
factory = new JedisConnectionFactory();
|
|
|
|
return factory;
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
factory = new JedisConnectionFactory(jedisPoolConfig());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
JedisConnectionFactory factory = new JedisConnectionFactory();
|
|
|
|
|
|
|
|
factory.setHostName(this.properties.getHost());
|
|
|
|
factory.setHostName(this.properties.getHost());
|
|
|
|
factory.setPort(this.properties.getPort());
|
|
|
|
factory.setPort(this.properties.getPort());
|
|
|
|
if (this.properties.getPassword() != null) {
|
|
|
|
if (this.properties.getPassword() != null) {
|
|
|
|