-
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
feat: 백엔드 서버와 크롤러 서버 간의 통신 기능을 구현 #69
Open
boyekim
wants to merge
20
commits into
main
Choose a base branch
from
feat/67-crawler-data
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Open
Test Results59 tests 59 ✅ 6s ⏱️ Results for commit 290c641. ♻️ This comment has been updated with latest results. |
로직 수정했습니다. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
작업 내용
우선, SeatStorage를 Map으로 자료구조 변경했습니다.
키값은 subjectId를 의도했어요.
그리고 백엔드 서버와 크롤러 서버 간의 통신 기능을 구현했습니다.
백엔드 서버 -> 크롤러 서버
백엔드 서버는 크롤러 서버에게 받을 정보를 알려줍니다.
크롤러 서버에 알려줄 정보는 교양과목이랑 핀 과목을 우선 구현했어요.
TopNonMajorStorage
에 저장해두는 api를 구현했어요. 이곳에는 subjectId만 저장해요. 한번만 실행되면 됩니다. Map 자료구조를 사용하고 있어서, 여러번 호출한다고 데이터가 중복으로 쌓이진 않을 것 같아요.CrawlerClient
에 구현되어있어요.@Scheduled
어노테이션을 사용하여서 api는 없구요, 1분 주기로 걸어놨는데 이게 과연 적절할지 합의가 필요해요.크롤러 서버 -> 백엔드 서버
크롤러 서버는 백엔드 서버에 받은 정보를 기준으로 SSE로 여석을 계속 내려줍니다.
SseClientService
클래스에서HttpURLConnection
를 통해 받는데요... 정말 처음 구현해보는거라 같이 꼼꼼히 봐주시면 정말 감사하겠어요....🥹🥹🥹🐥🐥 이 요청을 받으려면 따로@Component
등록하는 과정이 필요해서SseClientSetting
이란 클래스를 만들었어요이거 정말 처음 사용해보고 구현해보는거라서 좀 불안하네요
이런 식으로 응답을 받아서요, SeatStorage를 id 기반으로 계속 업뎃 해주는 걸 의도하고 구현했어요. 이런식으로 응답 주시면 감사하겠습니당.
코드 잘짰는지 모르겠어요...ㅠㅜ 아직 테스트가 없어서요...ㅜㅜㅜ 그런데 이거 연결이 끊어질수도 있잖아요...? 백엔드 서버에서 주기적으로 요청을 보내야하는걸까요..? 이 지점을 아직 잘 모르겠네요...ㅜㅜㅜ
고민 지점과 리뷰 포인트