mirror of
https://github.com/cna-bootcamp/phonebill.git
synced 2026-01-21 10:06:24 +00:00
Redis 연결 문제 수정: Spring Boot 자동 설정 사용하도록 변경
- product-service: RedisConnectionFactory 빈 제거 - bill-service: spring.data.redis 프로퍼티 경로 수정 - 환경변수 REDIS_HOST를 올바르게 읽도록 개선
This commit is contained in:
parent
f18d821d7d
commit
72aa1faa76
@ -41,19 +41,19 @@ import java.util.Map;
|
||||
@EnableCaching
|
||||
public class RedisConfig {
|
||||
|
||||
@Value("${spring.redis.host:localhost}")
|
||||
@Value("${spring.data.redis.host:localhost}")
|
||||
private String redisHost;
|
||||
|
||||
@Value("${spring.redis.port:6379}")
|
||||
@Value("${spring.data.redis.port:6379}")
|
||||
private int redisPort;
|
||||
|
||||
@Value("${spring.redis.password:}")
|
||||
@Value("${spring.data.redis.password:}")
|
||||
private String redisPassword;
|
||||
|
||||
@Value("${spring.redis.database:0}")
|
||||
@Value("${spring.data.redis.database:0}")
|
||||
private int redisDatabase;
|
||||
|
||||
@Value("${spring.redis.timeout:5000}")
|
||||
@Value("${spring.data.redis.timeout:5000}")
|
||||
private int redisTimeout;
|
||||
|
||||
/**
|
||||
|
||||
@ -36,18 +36,10 @@ import java.util.Map;
|
||||
@Configuration
|
||||
public class RedisConfig {
|
||||
|
||||
/**
|
||||
* Redis 연결 팩토리 (기본값 사용)
|
||||
*/
|
||||
@Bean
|
||||
@Primary
|
||||
public RedisConnectionFactory redisConnectionFactory() {
|
||||
return new LettuceConnectionFactory();
|
||||
}
|
||||
|
||||
/**
|
||||
* RedisTemplate 설정
|
||||
* String-Object 형태의 데이터 처리
|
||||
* Spring Boot 자동 설정으로 생성된 RedisConnectionFactory를 주입받아 사용
|
||||
*/
|
||||
@Bean
|
||||
@Primary
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user