Skip to content
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

Merged
merged 3 commits into from
Apr 9, 2024

Conversation

pdohyung
Copy link
Member

@pdohyung pdohyung commented Apr 8, 2024

💡 연관된 이슈

close #67

📝 작업 내용

  • Redis Sorted Set으로 실시간 검색어 기능 구현

💬 리뷰 요구 사항

현재는 검색어에 점수를 부여하여 조회하는 기능입니다.
궁금한 점이나 의견 있으면 남겨주세요 ! 😊

@pdohyung pdohyung added the ✨ Feature 기능 개발 label Apr 8, 2024
@pdohyung pdohyung self-assigned this Apr 8, 2024
@pdohyung pdohyung linked an issue Apr 8, 2024 that may be closed by this pull request
1 task
@pdohyung pdohyung requested review from jwooo and AHNYUNKI April 8, 2024 15:14
Copy link
Collaborator

@jwooo jwooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 👍

궁금한게 있어 리뷰 남겼습니다. 확인 부탁 드립니다!!

Comment on lines +36 to +58
@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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

위와 같이 설정하면 redisTemplate을 사용되는 클래스에서 @Qualifier 미사용 시 redisConnectionFactoryFirst가 사용되는 건가요?

Copy link
Member Author

@pdohyung pdohyung Apr 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 맞습니다.
@Primary가 있는 설정이 우선적으로 적용됩니다.
레디스 멀티 DB 환경을 구축할 때, @Primary를 사용하지 않으면 오류가 발생합니다 !

Copy link
Member

@AHNYUNKI AHNYUNKI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!!

@pdohyung pdohyung force-pushed the feature/67-real-time-search-term-api branch from 4930c20 to fb4611f Compare April 9, 2024 11:45
@pdohyung pdohyung merged commit ffdb0ce into develop Apr 9, 2024
1 check passed
@pdohyung pdohyung deleted the feature/67-real-time-search-term-api branch April 9, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] 실시간 검색어 API 구현
3 participants