|
|
|
@ -16,8 +16,6 @@
|
|
|
|
|
|
|
|
|
|
package org.springframework.boot.autoconfigure.data.redis;
|
|
|
|
|
|
|
|
|
|
import java.net.UnknownHostException;
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
|
|
@ -54,8 +52,7 @@ public class RedisAutoConfiguration {
|
|
|
|
|
@Bean
|
|
|
|
|
@ConditionalOnMissingBean(name = "redisTemplate")
|
|
|
|
|
@ConditionalOnSingleCandidate(RedisConnectionFactory.class)
|
|
|
|
|
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory)
|
|
|
|
|
throws UnknownHostException {
|
|
|
|
|
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory redisConnectionFactory) {
|
|
|
|
|
RedisTemplate<Object, Object> template = new RedisTemplate<>();
|
|
|
|
|
template.setConnectionFactory(redisConnectionFactory);
|
|
|
|
|
return template;
|
|
|
|
@ -64,8 +61,7 @@ public class RedisAutoConfiguration {
|
|
|
|
|
@Bean
|
|
|
|
|
@ConditionalOnMissingBean
|
|
|
|
|
@ConditionalOnSingleCandidate(RedisConnectionFactory.class)
|
|
|
|
|
public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory redisConnectionFactory)
|
|
|
|
|
throws UnknownHostException {
|
|
|
|
|
public StringRedisTemplate stringRedisTemplate(RedisConnectionFactory redisConnectionFactory) {
|
|
|
|
|
StringRedisTemplate template = new StringRedisTemplate();
|
|
|
|
|
template.setConnectionFactory(redisConnectionFactory);
|
|
|
|
|
return template;
|
|
|
|
|