From 0a43550eebc08f3bfb1ef8427a7c36ffe4065571 Mon Sep 17 00:00:00 2001 From: HeoSeokMun Date: Sun, 25 Aug 2024 23:46:03 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20redis=20=EC=84=A4=EC=A0=95=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/backgu/amaker/realtime/config/ProdRedisConfig.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/realtime/src/main/kotlin/com/backgu/amaker/realtime/config/ProdRedisConfig.kt b/realtime/src/main/kotlin/com/backgu/amaker/realtime/config/ProdRedisConfig.kt index 53cef05f..618822bd 100644 --- a/realtime/src/main/kotlin/com/backgu/amaker/realtime/config/ProdRedisConfig.kt +++ b/realtime/src/main/kotlin/com/backgu/amaker/realtime/config/ProdRedisConfig.kt @@ -1,5 +1,6 @@ package com.backgu.amaker.realtime.config +import com.backgu.amaker.infra.redis.session.SessionRedisData import io.lettuce.core.SocketOptions import io.lettuce.core.cluster.ClusterClientOptions import io.lettuce.core.cluster.ClusterTopologyRefreshOptions @@ -14,6 +15,7 @@ import org.springframework.data.redis.connection.lettuce.LettuceClientConfigurat import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory import org.springframework.data.redis.core.RedisTemplate import org.springframework.data.redis.repository.configuration.EnableRedisRepositories +import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer import org.springframework.data.redis.serializer.StringRedisSerializer import java.time.Duration @@ -65,11 +67,11 @@ class ProdRedisConfig( } @Bean - fun redisTemplate(): RedisTemplate { - val template = RedisTemplate() + fun redisTemplate(): RedisTemplate { + val template = RedisTemplate() template.connectionFactory = redisConnectionFactory() template.keySerializer = StringRedisSerializer() - template.valueSerializer = StringRedisSerializer() + template.valueSerializer = GenericJackson2JsonRedisSerializer() return template } }