Skip to content

feat(chat): 채팅방 채팅 메세지 전달 로직 디버깅 (#78)#167

Merged
jaehyeok-code merged 1 commit intodevfrom
feat/#78
Aug 26, 2025
Merged

feat(chat): 채팅방 채팅 메세지 전달 로직 디버깅 (#78)#167
jaehyeok-code merged 1 commit intodevfrom
feat/#78

Conversation

@jaehyeok-code
Copy link
Contributor

@jaehyeok-code jaehyeok-code commented Aug 26, 2025

Summary by CodeRabbit

  • 신기능
    • 채팅 메시지 응답에 생성 시각(createdAt)이 포함됩니다.
  • Refactor
    • 채팅 전송 API가 /chat/send로 변경되고 roomId를 요청 본문에서 받습니다.
    • 실시간 전송 채널을 정리해 WebSocket 대상이 /topic/chat/{roomId}로 일관화되었습니다.
    • Redis 구독/발행 채널을 chat/*로 확장해 채팅 룸별 전달을 개선했습니다.
    • 초안(draft) 관련 브로드캐스트 목적지가 /chat/{draftId}로 변경되었습니다.

@jaehyeok-code jaehyeok-code self-assigned this Aug 26, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

채팅 전송 흐름이 변경되었습니다. 컨트롤러의 엔드포인트가 /chat/send 로 바뀌고 roomId를 요청 본문에서 읽습니다. Redis 게시 메서드는 예외를 호출자에게 전파하며 디버깅 출력이 추가되었습니다. Redis 리스너는 chat/* 토픽을 구독하고, 수신 메시지를 /chat/{id}로 브로드캐스트합니다.

Changes

Cohort / File(s) Change Summary
Chat publish flow
backendProject/.../domain/chat/controller/ChatMessagingController.java, backendProject/.../domain/chat/bus/ChatRedisPublisher.java
컨트롤러 send 경로를 /chat/send로 변경, roomId를 req에서 사용, Redis 채널을 chat.{roomId}로 사용, payload에 createdAt 추가. Publisher는 try-catch 제거, JsonProcessingException throws 선언, 디버그 출력 추가.
Redis configuration
backendProject/.../global/configuration/RedisConfig.java
RedisMessageListenerContainer에 chat/* 토픽 리스너를 추가 등록. 기존 draft.* 구독 유지.
Redis subscriber routing
backendProject/.../global/redis/RedisSubscriber.java
onMessage의 브로드캐스트 목적지를 /topic/draft.{id}에서 /chat/{id}로 변경(이전 라인은 주석 처리).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Client
  participant C as ChatMessagingController
  participant P as ChatRedisPublisher
  participant R as Redis (pub/sub)
  participant S as RedisSubscriber
  participant WS as WebSocket Broker

  Client->>C: /app/chat/send (ChatSendRequest{roomId, content})
  C->>C: 멤버십 체크, 메시지 저장
  C->>WS: /topic/chat/{roomId} 즉시 브로드캐스트
  C->>P: publishToRoom("chat.{roomId}", payload)
  P->>R: convertAndSend("chat.{roomId}", json)
  R-->>S: 메시지 전달 (chat/*)
  S->>WS: /chat/{roomId}로 브로드캐스트
  note over WS,Client: 구독 클라이언트에게 전달
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • hwichoi0317
  • Kim-Jaehyun0328
  • wjkim9
  • roode1017

Poem

작은 발로 키보드 탁탁, hop-hop, 코드 춤춰요 🐇
경로는 새로, 예외는 위로, 채널은 chat으로!
Redis에 속삭이고, 소켓에 전해요—슝—
메시지 씨앗 틔워, 방마다 봄바람 불게.
오늘도 깡총, 배포는 성공!

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between cf856db and a0d01f1.

📒 Files selected for processing (4)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/chat/bus/ChatRedisPublisher.java (2 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/domain/chat/controller/ChatMessagingController.java (5 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/configuration/RedisConfig.java (1 hunks)
  • backendProject/src/main/java/likelion/mlb/backendProject/global/redis/RedisSubscriber.java (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#78

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@jaehyeok-code jaehyeok-code merged commit 7c14b7d into dev Aug 26, 2025
1 check was pending
@jaehyeok-code jaehyeok-code deleted the feat/#78 branch August 26, 2025 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant