Skip to content

Commit

Permalink
Add: Redis config
Browse files Browse the repository at this point in the history
  • Loading branch information
pingowl committed Nov 11, 2023
1 parent becdbab commit e1c38e2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ dependencies {
annotationProcessor "jakarta.persistence:jakarta.persistence-api"

implementation 'com.google.firebase:firebase-admin:9.1.1'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
}

// Querydsl 설정부
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/igoMoney/BE/common/config/RedisConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package igoMoney.BE.common.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;

@Configuration
public class RedisConfig {

@Value("${spring.data.redis.host}")
private String host;

@Value("${spring.data.redis.port}")
private int port;

@Bean
public RedisConnectionFactory redisConnectionFactory() {
return new LettuceConnectionFactory(host, port);
}
}
4 changes: 4 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ spring:
apple:
authorizationUri: https://appleid.apple.com/auth/authorize?response_mode=form_post
tokenUri: https://appleid.apple.com/auth/token
data:
redis:
port: ${spring.data.redis.port}
host: ${spring.data.redis.host}

jwt:
secret: ${application.jwt.secret}
Expand Down

0 comments on commit e1c38e2

Please sign in to comment.