[Feature] PushWorker 구현 (RabbitMQ Consumer) #110

Closed
opened 2026-02-10 07:11:36 +00:00 by seonkyu.kim · 0 comments
Owner

설명

RabbitMQ spms.push.queue에서 메시지를 소비하여 FCM/APNs로 발송하는 BackgroundService Worker를 구현한다.

📌 참조: Documents/BatchScheduler_Design.md §2 (PushWorker), Documents/RabbitMQ_Design.md §6.1 (Consumer 설정)

처리 흐름

  1. 메시지 수신 (RabbitMQ Consumer)
  2. Redis 중복 체크 (duplicate:{request_id})
  3. send_type별 대상 Device 조회
  4. 플랫폼별 분류 (iOS → APNs, Android → FCM)
  5. 배치 발송 (500건 단위)
  6. 결과 처리 (PushSendLog INSERT)
  7. DailyStat 증분 업데이트
  8. ACK 전송

체크리스트

Worker 구현

  • SPMS.Infrastructure/Workers/PushWorker.cs — BackgroundService 상속
    • RabbitMQ Consumer (Prefetch 10, Manual Ack)
    • 메시지 수신 → JSON 역직렬화 → 중복체크 → 디바이스 조회 → 발송 → 결과 처리

에러 처리

  • 재시도 정책 (x-retry-count 헤더, 최대 3회)
  • FCM/APNs 응답별 디바이스 처리 (ShouldRemoveDevice → 비활성화)

등록

  • SPMS.Infrastructure/DependencyInjection.cs — HostedService 등록
## 설명 RabbitMQ `spms.push.queue`에서 메시지를 소비하여 FCM/APNs로 발송하는 BackgroundService Worker를 구현한다. > **📌 참조**: `Documents/BatchScheduler_Design.md` §2 (PushWorker), `Documents/RabbitMQ_Design.md` §6.1 (Consumer 설정) ## 처리 흐름 1. 메시지 수신 (RabbitMQ Consumer) 2. Redis 중복 체크 (`duplicate:{request_id}`) 3. `send_type`별 대상 Device 조회 4. 플랫폼별 분류 (iOS → APNs, Android → FCM) 5. 배치 발송 (500건 단위) 6. 결과 처리 (PushSendLog INSERT) 7. DailyStat 증분 업데이트 8. ACK 전송 ## 체크리스트 ### Worker 구현 - [x] `SPMS.Infrastructure/Workers/PushWorker.cs` — BackgroundService 상속 - RabbitMQ Consumer (Prefetch 10, Manual Ack) - 메시지 수신 → JSON 역직렬화 → 중복체크 → 디바이스 조회 → 발송 → 결과 처리 ### 에러 처리 - [x] 재시도 정책 (x-retry-count 헤더, 최대 3회) - [x] FCM/APNs 응답별 디바이스 처리 (ShouldRemoveDevice → 비활성화) ### 등록 - [x] `SPMS.Infrastructure/DependencyInjection.cs` — HostedService 등록
seonkyu.kim added the
Priority
Urgent
Status
In Progress
Type
Feature
labels 2026-02-10 07:11:46 +00:00
seonkyu.kim added this to the Phase 3: 메시지 & Push Core milestone 2026-02-10 07:11:49 +00:00
seonkyu.kim self-assigned this 2026-02-10 07:13:02 +00:00
seonkyu.kim added
Status
Done
and removed
Status
In Progress
labels 2026-02-10 07:19:11 +00:00
Sign in to join this conversation.
No description provided.