Repository navigation
Conversation
|
Important Review skippedToo many files! This PR contains 108 files, which is 8 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.
|
hyxklee
reviewed
Nov 13, 2026
| // --- AWS SDK v2 (BOM) --- | ||
| implementation(platform("software.amazon.awssdk:bom:$awsSdkBomVersion")) | ||
| implementation("software.amazon.awssdk:s3") | ||
| implementation("software.amazon.awssdk:sqs") |
Member
There was a problem hiding this comment.
SQS 사용시 예상 처리량, 예상 금액, 예상 딜레이는 어떻게 될까요??
4 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Summary
공지 알림 발송을 Transactional Outbox와 SQS 기반으로 분리하고 중복 처리 방지·재시도·실패 추적을 구현했습니다.
📝 Changes
What
Why
How
📸 Screenshots / Logs
알림 시스템 아키텍처와 발송 흐름
설명 기준: PR #136,
2e25d7a. 원본 저장부터 실패 복구까지의 공통 기반입니다. 일정·세션·회비 연결은 PR #141에서 추가합니다.전체 구조
아래는
notification.dispatch.enabled=true경로입니다. 현재 소비자는 Spring 프로세스 안의 워커이며 Lambda는 사용하지 않습니다. 기본값은false로, 기존AFTER_COMMIT + @Async직접 발송 경로가 동작합니다.flowchart TB subgraph API["Spring API 프로세스"] B["비즈니스 UseCase"] --> E["BEFORE_COMMIT 이벤트 리스너"] E --> C["CreateNotificationUseCase: 설정 확인 + 템플릿"] C --> D["같은 DB 트랜잭션: 원본 + 앱 알림 + Delivery + Outbox"] R["Outbox Relay"] W["전용 Spring 워커"] W --> P["prepare 트랜잭션: 선점 + 대상 재확인"] P --> I["FCM I/O 전용 풀: DB 트랜잭션 밖"] I --> K["complete 트랜잭션: 토큰별 결과 저장"] end D -->|커밋된 행만 조회| R R -->|deliveryId + eventId + generation| Q["Amazon SQS"] Q -->|long polling| W I --> F["FCM"] K -->|ACK면 메시지 삭제| Q K -->|일시 실패면 visibility 연기| Q Q -->|AWS redrive 정책| L["DLQ"] L --> A["감사 작업: Incident 저장 + DLQ 보존"]요청 트랜잭션과 외부 호출의 경계
원본·앱 알림·Delivery·Outbox를 같은 DB 트랜잭션으로 저장합니다. 커밋된 Outbox를 Relay가 선점한 뒤 DB 트랜잭션 밖에서 SQS에 게시합니다. 워커도 prepare와 complete 사이에서 FCM을 트랜잭션 밖으로 호출합니다.
sequenceDiagram participant U as 사용자 participant B as 비즈니스 UseCase participant DB as MySQL participant R as Relay participant Q as SQS participant W as 워커 participant F as FCM U->>B: 공지 등록 요청 B->>DB: 원본 + 앱 알림 + Delivery + Outbox 저장 Note over B,DB: BEFORE_COMMIT까지 같은 트랜잭션 DB-->>B: COMMIT B-->>U: 요청 응답 R->>DB: Outbox 선점 및 lease 기록 DB-->>R: 최대 10개 dispatch R->>Q: 트랜잭션 밖 batch publish Q-->>R: 항목별 성공 결과 R->>DB: 게시 결과 저장 Q-->>W: receive message W->>DB: prepare: claim 및 수신자 재확인 DB-->>W: 대상 토큰 스냅샷 W->>F: 트랜잭션 밖 발송 F-->>W: 토큰별 성공 또는 실패 W->>DB: complete 결과 COMMIT alt 다음 작업 없음 W->>Q: DeleteMessage else 일시 실패 잔존 W->>Q: ChangeMessageVisibility Q-->>W: 대기 후 재전달 else 재시도 소진 Note over W,Q: 삭제하지 않고 DLQ 이동 대기 end상태와 재시도
NotificationFailure에 기록하고 작업 생성을 종료합니다.장애 예시와 보장 범위
수신자 조회·렌더링·DB 작업 저장은 요청 처리에 남습니다. 현재 워커 기본값 2개는 부하 테스트로 확정한 처리량 수치가 아닙니다.
코드 읽기 순서
💡 Reviewer 참고사항
✅ Checklist