[Bug] RabbitMQ 연결 실패 시 앱 크래시 방지 #124

Closed
opened 2026-02-10 10:04:06 +00:00 by seonkyu.kim · 0 comments
Owner

설명

RabbitMQInitializer가 IHostedService로 등록되어 있어, StartAsync에서 RabbitMQ 연결 실패 시 예외가 throw되어 앱 전체가 크래시된다.

현상

  • RabbitMQ 컨테이너가 아직 준비되지 않았거나 일시적으로 연결 불가한 경우 API 서버 자체가 시작되지 않음
  • docker-compose에서 depends_on에 spms-mq가 없어 타이밍 이슈 발생 가능

해결 방안

  • RabbitMQInitializer.StartAsync에서 예외 발생 시 throw 대신 LogWarning으로 변경
  • Exchange/Queue 초기화 로직을 별도 메서드로 분리 (재시도 가능)
  • RabbitMQ 연결은 lazy 방식으로 실제 메시지 발송 시 재연결

체크리스트

Infrastructure Layer

  • RabbitMQInitializer.cs — StartAsync에서 throw 제거, 경고 로그로 변경
  • RabbitMQInitializer.cs — InitializeAsync 메서드 분리
## 설명 RabbitMQInitializer가 IHostedService로 등록되어 있어, StartAsync에서 RabbitMQ 연결 실패 시 예외가 throw되어 앱 전체가 크래시된다. ### 현상 - RabbitMQ 컨테이너가 아직 준비되지 않았거나 일시적으로 연결 불가한 경우 API 서버 자체가 시작되지 않음 - docker-compose에서 depends_on에 spms-mq가 없어 타이밍 이슈 발생 가능 ### 해결 방안 - RabbitMQInitializer.StartAsync에서 예외 발생 시 throw 대신 LogWarning으로 변경 - Exchange/Queue 초기화 로직을 별도 메서드로 분리 (재시도 가능) - RabbitMQ 연결은 lazy 방식으로 실제 메시지 발송 시 재연결 ## 체크리스트 ### Infrastructure Layer - [ ] `RabbitMQInitializer.cs` — StartAsync에서 throw 제거, 경고 로그로 변경 - [ ] `RabbitMQInitializer.cs` — InitializeAsync 메서드 분리
seonkyu.kim added the
Priority
High
Status
Available
Type
Bug
labels 2026-02-10 10:04:13 +00:00
seonkyu.kim added this to the Phase 3: 메시지 & Push Core milestone 2026-02-10 10:04:16 +00:00
seonkyu.kim self-assigned this 2026-02-10 10:04:18 +00:00
seonkyu.kim added
Status
Done
and removed
Status
Available
labels 2026-02-10 10:17:31 +00:00
Sign in to join this conversation.
No description provided.