diff --git a/src/main/java/com/dnd/jjakkak/global/config/redis/RedisConfig.java b/src/main/java/com/dnd/jjakkak/global/config/redis/RedisConfig.java index ebca380..8241937 100644 --- a/src/main/java/com/dnd/jjakkak/global/config/redis/RedisConfig.java +++ b/src/main/java/com/dnd/jjakkak/global/config/redis/RedisConfig.java @@ -5,6 +5,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.connection.RedisStandaloneConfiguration; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.repository.configuration.EnableRedisRepositories; @@ -14,11 +15,18 @@ @Configuration @EnableRedisRepositories public class RedisConfig { + private final RedisProperties redisProperties; @Bean public RedisConnectionFactory redisConnectionFactory() { - return new LettuceConnectionFactory(redisProperties.getHost(), redisProperties.getPort()); + + RedisStandaloneConfiguration configuration = new RedisStandaloneConfiguration(); + configuration.setHostName(redisProperties.getHost()); + configuration.setPort(redisProperties.getPort()); + configuration.setPassword(redisProperties.getPassword()); + + return new LettuceConnectionFactory(configuration); } @Bean