-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] 실시간 검색어 API 구현 #70
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다 👍
궁금한게 있어 리뷰 남겼습니다. 확인 부탁 드립니다!!
@Primary | ||
@Bean(name = "redisConnectionFactoryFirst") | ||
public LettuceConnectionFactory redisConnectionFactoryFirst() { | ||
RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration(); | ||
|
||
redisStandaloneConfiguration.setHostName(host); | ||
redisStandaloneConfiguration.setPort(port); | ||
redisStandaloneConfiguration.setPassword(password); | ||
redisStandaloneConfiguration.setDatabase(0); | ||
|
||
return new LettuceConnectionFactory(redisStandaloneConfiguration); | ||
} | ||
|
||
@Bean | ||
public RedisTemplate<?, ?> redisTemplate() { | ||
RedisTemplate<?, ?> redisTemplate = new RedisTemplate<>(); | ||
@Bean(name = "redisConnectionFactorySecond") | ||
public LettuceConnectionFactory redisConnectionFactorySecond() { | ||
RedisStandaloneConfiguration redisStandaloneConfiguration = new RedisStandaloneConfiguration(); | ||
|
||
redisStandaloneConfiguration.setHostName(host); | ||
redisStandaloneConfiguration.setPort(port); | ||
redisStandaloneConfiguration.setPassword(password); | ||
redisStandaloneConfiguration.setDatabase(1); | ||
|
||
return new LettuceConnectionFactory(redisStandaloneConfiguration); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위와 같이 설정하면 redisTemplate
을 사용되는 클래스에서 @Qualifier
미사용 시 redisConnectionFactoryFirst
가 사용되는 건가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네 맞습니다.
@Primary
가 있는 설정이 우선적으로 적용됩니다.
레디스 멀티 DB 환경을 구축할 때, @Primary
를 사용하지 않으면 오류가 발생합니다 !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다!!
4930c20
to
fb4611f
Compare
💡 연관된 이슈
close #67
📝 작업 내용
💬 리뷰 요구 사항
현재는 검색어에 점수를 부여하여 조회하는 기능입니다.
궁금한 점이나 의견 있으면 남겨주세요 ! 😊