diff --git a/src/main/java/com/numberone/backend/config/RedisConfig.java b/src/main/java/com/numberone/backend/config/RedisConfig.java index 5c8c7ea8..0f836e9d 100644 --- a/src/main/java/com/numberone/backend/config/RedisConfig.java +++ b/src/main/java/com/numberone/backend/config/RedisConfig.java @@ -2,6 +2,7 @@ import com.numberone.backend.properties.RedisProperties; import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; @@ -14,9 +15,12 @@ public class RedisConfig { private final RedisProperties redisProperties; + @Value("${spring.redis.host}") + private String host; + @Bean public RedisConnectionFactory redisConnectionFactory() { - return new LettuceConnectionFactory(redisProperties.getHost(), redisProperties.getPort()); + return new LettuceConnectionFactory(host, redisProperties.getPort()); } @Bean