diff --git a/gateway/src/main/java/com/oing/config/support/RedisLocalConfig.java b/gateway/src/main/java/com/oing/config/support/RedisLocalConfig.java deleted file mode 100644 index f7215859..00000000 --- a/gateway/src/main/java/com/oing/config/support/RedisLocalConfig.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.oing.config.support; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Profile; -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.serializer.GenericJackson2JsonRedisSerializer; -import org.springframework.data.redis.serializer.StringRedisSerializer; - -@Profile("local") -@Configuration -public class RedisLocalConfig { - - @Value("${spring.data.redis.host}") - private String redisHost; - - @Value("${spring.data.redis.port}") - private int redisPort; - - @Bean - public RedisConnectionFactory redisConnectionFactory() { - return new LettuceConnectionFactory(new RedisStandaloneConfiguration(redisHost, redisPort)); - } - - @Bean - public RedisTemplate redisTemplate() { - RedisTemplate redisTemplate = new RedisTemplate<>(); - redisTemplate.setConnectionFactory(redisConnectionFactory()); - redisTemplate.setKeySerializer(new StringRedisSerializer()); - - /* Java 기본 직렬화가 아닌 JSON 직렬화 설정 */ - redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer()); - - return redisTemplate; - } -}