Skip to content

[feat] 하트비트 구현 #172

Merged
sehee123 merged 8 commits into
devfrom
feat/118
Jul 31, 2025
Merged

[feat] 하트비트 구현 #172
sehee123 merged 8 commits into
devfrom
feat/118

Conversation

@sehee123
Copy link
Copy Markdown
Collaborator

@sehee123 sehee123 commented Jul 30, 2025

🛰️ Issue Number

🪐 작업 내용

  • 클라이언트에서 3번이상 응답이 안올 경우 유저 퇴장처리를 하기위해 stomp의 기본 하트비트를 설정하지않고 send 요청으로 하트비트를 구현(ping-pong)
  • 15초 간격으로 ping 을 보내면서 카운트를 1 증가시키고, pong 응답이 오면 카운트를 0으로 초기화.
  • 이때 ping 을 보내는건 스케줄러로 구현하였고 연결된 세션이 있을때만 동작
  • 테스트는 임시로 FE코드를 수정하였음.

15초 간격으로 ping보내고 pong 받기
image

  • FE에서도 마찬가지로 ping 응답이 일정 간격을 두고 3번이상 오지 않으면 deactivate()하는 로직 구현 필요

📚 Reference

✅ Check List

  • 코드가 정상적으로 컴파일되나요?
  • 테스트 코드를 통과했나요?
  • merge할 브랜치의 위치를 확인했나요?
  • Label을 지정했나요?

@sehee123 sehee123 self-assigned this Jul 30, 2025
@sehee123 sehee123 added the enhancement New feature or request label Jul 30, 2025
@sehee123 sehee123 linked an issue Jul 30, 2025 that may be closed by this pull request
1 task
Copy link
Copy Markdown
Collaborator

@jiwon1217 jiwon1217 left a comment

Choose a reason for hiding this comment

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

늦은 시간까지 고생 많으셨습니다 !


roomService.disconnectOrExitRoom(roomId, userPrincipal);
}
missedPongCounter.remove(sessionId);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[L5-참고의견]
미리 정의된 cleanSession 메서드를 사용하셔도 될 것 같습니다.

private void handleSessionHeartbeat(SimpUser user, SimpSession session) {
String sessionId = session.getId();

/* pong */
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[L5-참고의견]
서버에서는 HEARTBEAT ping을 전송하는 것 같은데, 혹시 해당 주석 부분이 pong이 맞는지 확인 부탁드립니다.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

헉!!!! 맞아요 이부분은 서버가 보내는거니까 ping이 맞습니다

Copy link
Copy Markdown
Collaborator

@LimKangHyun LimKangHyun left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

@sehee123 sehee123 merged commit 70fc1f8 into dev Jul 31, 2025
2 of 3 checks passed
@sehee123 sehee123 deleted the feat/118 branch July 31, 2025 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] 하트비트 추가

4 participants