Skip to content

Commit

Permalink
fix: redis config 파일 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
van1164 committed Jun 2, 2024
1 parent fcb8324 commit 2a1690d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions util/src/main/kotlin/com/van1164/common/redis/RedisConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import org.springframework.data.redis.serializer.StringRedisSerializer
class RedisConfig {

@Value("\${spring.data.redis.host}")
lateinit var host: String
lateinit var myHost: String

@Value("\${spring.data.redis.port}")
var port: Int = 6379
var myPort: Int = 6379

@Value("\${spring.data.redis.password}")
lateinit var myPassword: String
Expand All @@ -35,8 +35,8 @@ class RedisConfig {
@Bean
fun redisConnectionFactory(): RedisConnectionFactory {
val configuration = RedisStandaloneConfiguration().apply {
host = host
port = port
hostName = myHost
port = myPort
password = RedisPassword.of(myPassword)
}
val lettuceConnectionFactory = LettuceConnectionFactory(configuration)
Expand All @@ -47,10 +47,13 @@ class RedisConfig {
@Bean
fun reactiveRedisConnectionFactory(): ReactiveRedisConnectionFactory {
val configuration = RedisStandaloneConfiguration().apply {
host = host
port = port
hostName = myHost
this.port = myPort
password = RedisPassword.of(myPassword)
}
println(configuration.hostName)
println(configuration.port)
println(configuration.password)
val lettuceConnectionFactory = LettuceConnectionFactory(configuration)
lettuceConnectionFactory.start()
return lettuceConnectionFactory
Expand Down

0 comments on commit 2a1690d

Please sign in to comment.