From 0dfa42478a268343d813a165d80c89317e79fce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EA=B5=90=ED=9C=98?= Date: Wed, 17 Jul 2024 22:57:38 +0900 Subject: [PATCH] redis config: add secrets --- .../soongsil/CoffeeChat/config/redis/RedisConfig.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/soongsil/CoffeeChat/config/redis/RedisConfig.java b/src/main/java/com/soongsil/CoffeeChat/config/redis/RedisConfig.java index 2cded4d..6e1f3ed 100644 --- a/src/main/java/com/soongsil/CoffeeChat/config/redis/RedisConfig.java +++ b/src/main/java/com/soongsil/CoffeeChat/config/redis/RedisConfig.java @@ -1,5 +1,6 @@ package com.soongsil.CoffeeChat.config.redis; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; @@ -10,10 +11,16 @@ @Configuration public class RedisConfig { + @Value("${spring.redis.host}") + private String redisHost; + + @Value("${spring.redis.port}") + private int redisPort; @Bean public RedisConnectionFactory redisConnectionFactory() { - return new LettuceConnectionFactory(); + LettuceConnectionFactory lettuceConnectionFactory = new LettuceConnectionFactory(redisHost, redisPort); + return lettuceConnectionFactory; } @Bean