From 85b157339194355ea3757a0956756112f05a31ee Mon Sep 17 00:00:00 2001 From: Sambo Chea Date: Sun, 25 Jul 2021 19:05:19 +0700 Subject: [PATCH] Task: Add spring session and redis data for externalized session --- pom.xml | 11 ++++++++++- .../com/cubetiqs/fusion/config/SessionConfig.kt | 8 ++++++++ src/main/resources/application.yml | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/main/kotlin/com/cubetiqs/fusion/config/SessionConfig.kt diff --git a/pom.xml b/pom.xml index 0c0e6c1..6d62633 100644 --- a/pom.xml +++ b/pom.xml @@ -118,11 +118,11 @@ h2 + org.springframework.boot spring-boot-starter-data-jpa - org.springframework.boot spring-boot-starter-validation @@ -132,7 +132,16 @@ spring-boot-devtools true + + org.springframework.boot + spring-boot-starter-data-redis + + + org.springframework.session + spring-session-data-redis + + org.springframework.boot spring-boot-starter-test diff --git a/src/main/kotlin/com/cubetiqs/fusion/config/SessionConfig.kt b/src/main/kotlin/com/cubetiqs/fusion/config/SessionConfig.kt new file mode 100644 index 0000000..cd86e1a --- /dev/null +++ b/src/main/kotlin/com/cubetiqs/fusion/config/SessionConfig.kt @@ -0,0 +1,8 @@ +package com.cubetiqs.fusion.config + +import org.springframework.context.annotation.Configuration +import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession + +@Configuration +@EnableRedisHttpSession +class SessionConfig \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index f1a65e2..1f441df 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -6,6 +6,9 @@ logging: org.atmosphere: warn spring: + session: + store-type: redis + mustache: check-template-location: false