Api: ✨ 분산 코디네이션 도입을 고려한 서비스 탐색 서비스 API #162
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
작업 이유
채팅 서버와 Socket 연결을 위해, Client는 1차적으로 클라이언트의
물리적 위치(geographical location)
와서버의 용량(capacity)
을 기반으로 최적의 채팅 서버 url을 알아야 합니다.이번 작업은 이러한 기능을 고려하여 설계되었습니다.
작업 사항
초기 설계안이라 현재 클래스명과 다소 차이가 있습니다.
우선 위 설계는 한 가지 가정을 두고 시작합니다.
이를 완벽하게 구현하기 위해서는 Apache Zookeeper와 같은 분산 코디네이션 서비스(Distributed Coordination Service)를 사용하겠지만, 당연히 저희는 사용하지 않습니다! 😆
단, 수요가 있을 때, 언제든지 빠르게 적용하기 위해 모듈화의 이점을 극대화하여 위와 같이 설계하게 되었습니다.
📝 API Spec
GET /v2/socket/chat
리뷰어가 중점적으로 확인해야 하는 부분
발견한 이슈
ChatServerSearchService를 확인하면, CoordinatorService 빈에 주입이 제대로 이루어지지 않고 있다고 나올 텐데, 이상은 없습니다.
infra 모듈의 Config 파일에
@Configuration
을 사용하지 않고, 아래와 같이 의존성을 api 모듈이 제어하게 만듦으로써, IDE이 빈을 탐색하지 못할 뿐.실제 컴파일 타입에선 문제 없이 동작합니다. ^^