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

[#13] Fluent-bit를 활용, Websocket 채팅 구현 #17

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

lima1016
Copy link
Collaborator

@lima1016 lima1016 commented Feb 26, 2025

관련 이슈: #13, #16

내용:

Websocket으로 채팅방을 구현하고 Fluent-bit로 로그를 보내 Elasticsearch에 저장한다.

Fluent-bit 설정

  • 채팅 데이터를 Fluent-bit 서버로 전송하기위한 클래스
  • 관련 클래스:
    • com.lima.websocketservice.domain.chat.service
    • FluentBitService: 클라이언트로 부터 들어온 채팅 데이터를 가공하여 elasticsearch에 보내기 위한 작업, fluent-bit 서버로 전

Websocket을 사용한 채팅방 구현

  • 채팅 데이터를 받아서 Fluent-bit 서버로 보내기 직전의 작업에 대한 클래스, 기존에는 map에 담아서 사용했지만 redis pub/sub으로 바꾸어서 구독하고있는 룸에 메시지를 뿌려준다.
  • 관련 클래스:
    • com.lima.websocketservice.config
      • AppConfig: restTemplate과 redisMessageListenerContainer 사용을 위하여 bean을 등록하기 위한 클래스
      • WebSocketConfig: 소켓 통신을 위한 설정 클래스
    • com.lima.websocketservice.domain.chat
      • ChatWebSocketHandler: 소켓 통신이 들어오고 메시지가 나가고 통신이 끊어졌을때의 동작을 위한 클래스 (fluent-bit 전송전 클래스)

Test case (혼자 해보려고 하였으나 잘 되지 않아서 gpt의 도움을 많이 받았습니다...ㅠ)

  • ChatWebSocketHandlerTest

기타

  • fluent-bit.conf: 로그 레벨이나 각종 설정을 설정할 수 있지만 Filter는 통하지 않은거 처럼 보여서 좀더 테스트가 필요하다.

[내용] - 채팅방 생성, fluent-bit를 이용한 elasticsearch 데이터 저장
@lima1016 lima1016 added the ✨ Feature 기능 개발 label Feb 26, 2025
@lima1016 lima1016 self-assigned this Feb 26, 2025
@lima1016 lima1016 linked an issue Feb 26, 2025 that may be closed by this pull request
2 tasks
[내용] - 필요없는 파일 삭제
[내용] - redis를 이용한 채팅방 세션 관리
@lima1016 lima1016 linked an issue Feb 28, 2025 that may be closed by this pull request
2 tasks
@lima1016 lima1016 changed the title [#13] Fluent-bit를 활용, Websocket 채팅 구현(작성중) [#13] Fluent-bit를 활용, Websocket 채팅 구현 Mar 3, 2025
@lima1016 lima1016 linked an issue Mar 3, 2025 that may be closed by this pull request
1 task
lima1016 added 3 commits March 3, 2025 21:52
[내용] - test case 작성
[내용] - 필요없는 파일 삭제
[내용] - uri 수정
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.

Websocket Test Case 작성 fluentbit 활용확인 및 설정 Websocket으로 채팅 구현하기
1 participant