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

Socket: ✨ Chatroom Join Event Relay #185

Merged
merged 16 commits into from
Oct 30, 2024
Merged

Conversation

psychology50
Copy link
Member

@psychology50 psychology50 commented Oct 30, 2024

작업 이유

  • When the HTTP API publishes a chat-join event, the Socket-relay server listens to it and sends the message into the chatroom

작업 사항

1️⃣ ChatMessage Redis Key

  • The key for each chatroom message follows the format: chatroom:{chatroom_id}:message:{chat_id}
    • key's maximum value = (9 characters(chatroom:) + 19 characters(chatroom_id) + 9 characters(:message:) + 19 characters(chat_id)) * 2 bytes/char = 112 bytes.
    • Given Redis's 512MB key limit (536,870,912 bytes), we don’t need to use a hash algorithm for key compression.
    • While we could abbreviate chatroom to cr to save memory, this only confuses monitoring and is inefficient for memory conservation. Therefore, we will use complete words.

2️⃣ Design

  • same as Api: ✨ Implementing Chatroom Join API: A Bounded Context Approach #184
  • We need to implement this feature within the socket-relay module. However, as mentioned, the current server has insufficient memory.
  • Thus, I have integrated this feature directly in the socket module. In the future, if additional server resources become available, this feature can be transferred to the socket-relay module.

리뷰어가 중점적으로 확인해야 하는 부분

image
image
image

  • I checked the application running in the real environment. If you have any questions about the flow, feel free to ask.
  • I verified the unit tests in the DAO layer. Let me know if additional tests are needed.

발견한 이슈

  • Currently, no validation or exception handling is in the socket place. This topic may need to be addressed in a future update.

@psychology50 psychology50 added the enhancement New feature or request label Oct 30, 2024
@psychology50 psychology50 self-assigned this Oct 30, 2024
@psychology50 psychology50 merged commit 444ad64 into dev Oct 30, 2024
1 check passed
@psychology50 psychology50 deleted the feat/send-join-message branch October 30, 2024 11:00
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.

1 participant