feat: 실시간 알림(Realtime) 및 AI 메시징 인프라 구축#6
Conversation
Implement bridge package with envelope parsing and dispatcher for routing RabbitMQ messages to session subscribers. All 4 bridge tests pass with race detector enabled; full realtime suite (15 tests) passes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Jaeho-Site
left a comment
There was a problem hiding this comment.
Go언어 재밌네요. 앞으로 리뷰 야무지게 해보겠습니다.
| ch, err := conn.Channel() | ||
| if err != nil { | ||
| return err | ||
| } | ||
| defer ch.Close() | ||
|
|
There was a problem hiding this comment.
QoS 설정이 안되어있는데, 아직 로컬용이라 그런건지 궁금합니다.
There was a problem hiding this comment.
QoS prefetch is now set (prefetch=1) with contextual error handling; commit c343a57.
|
|
||
| closeCh := conn.NotifyClose(make(chan *amqp.Error, 1)) | ||
|
|
||
| for { |
There was a problem hiding this comment.
Connection만이 아니라 Channel 닫힘도 처리해주면 좋을 것 같아요.
There was a problem hiding this comment.
Channel close notifications are handled alongside connection close to trigger reconnect; commit c343a57.
| case err := <-closeCh: | ||
| return err |
There was a problem hiding this comment.
closeCh nil 반환 시 consumer 무음 종료되는 이슈 확인 부탁드려요
There was a problem hiding this comment.
Nil/closed close notifications now normalize to ErrClosed to avoid silent exit and force reconnect; commit c343a57.
|
@copilot 이 PR을 리뷰해줘 |
Agent-Logs-Url: https://github.com/Team-StackUp/stackup/sessions/f38bbbdd-14f5-46b7-beae-e66a9a7870c7 Co-authored-by: csh1668 <18442452+csh1668@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Agent-Logs-Url: https://github.com/Team-StackUp/stackup/sessions/f38bbbdd-14f5-46b7-beae-e66a9a7870c7 Co-authored-by: csh1668 <18442452+csh1668@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Team-StackUp/stackup/sessions/f38bbbdd-14f5-46b7-beae-e66a9a7870c7 Co-authored-by: csh1668 <18442452+csh1668@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Team-StackUp/stackup/sessions/f38bbbdd-14f5-46b7-beae-e66a9a7870c7 Co-authored-by: csh1668 <18442452+csh1668@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Team-StackUp/stackup/sessions/f38bbbdd-14f5-46b7-beae-e66a9a7870c7 Co-authored-by: csh1668 <18442452+csh1668@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Team-StackUp/stackup/sessions/f38bbbdd-14f5-46b7-beae-e66a9a7870c7 Co-authored-by: csh1668 <18442452+csh1668@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Team-StackUp/stackup/sessions/f38bbbdd-14f5-46b7-beae-e66a9a7870c7 Co-authored-by: csh1668 <18442452+csh1668@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Team-StackUp/stackup/sessions/f38bbbdd-14f5-46b7-beae-e66a9a7870c7 Co-authored-by: csh1668 <18442452+csh1668@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
| async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]: | ||
| runtime = MessagingRuntime(settings) | ||
| await runtime.start() | ||
| app.state.messaging = runtime | ||
| try: | ||
| yield | ||
| finally: | ||
| await runtime.stop() | ||
|
|
There was a problem hiding this comment.
runtime.start() 실패 시 finally 블록 진입 불가로 runtime.stop()이 호출되지 않고 RabbitMQ 연결이 좀비가 되는 문제가 있을 것 같아요.
There was a problem hiding this comment.
좀비 connection 막도록 try/finally 진입 순서를 변경해 runtime.start() 실패 시에도 stop() 이 호출되도록 수정했습니다. MessagingRuntime.stop() 은 내부 상태 None 가드가 있어 부분 초기화에서도 안전합니다. 회귀 방지 테스트(ai/tests/test_lifespan.py) 추가. commit 8eda222.
runtime.start()가 부분 초기화(connection open 후 exchange/queue declare 실패) 단계에서 raise하면 finally 블록 진입 불가로 stop()이 호출되지 않아 AMQP connection이 좀비가 되던 문제 수정. MessagingRuntime.stop()은 내부 상태 None 가드가 있어 부분 초기화 상태에서도 안전하다. PR #6 review (Jaeho-Site) 대응.
주요 작업 내용
이번 PR은 실시간 알림 시스템과 AI 메시지 처리 인프라를 구축하는 기초 작업(Bootstrap)을 포함하고 있습니다. AI 서버에서 발생한 이벤트를 RabbitMQ를 거쳐 Realtime 서버가 SSE(Server-Sent Events)를 통해 클라이언트에게 전달하는 전체 파이프라인을 구성했습니다.