Open
Conversation
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.
🔍 개요
🚀 주요 변경 내용
비동기 이벤트 기반 알림 저장 구현
ApplicationEventPublisher와@TransactionalEventListener를 활용하여 도메인 이벤트 기반 알림 시스템을 구현sequenceDiagram participant Client participant Controller participant Service participant EventPublisher participant EventListener participant NotificationService participant DB Client->>Controller: POST /callvan/posts/{id}/participants Controller->>Service: join(postId, userId) Service->>DB: 참여자 저장 Service->>EventPublisher: publishEvent(ParticipantJoinedEvent) Service-->>Controller: 완료 Controller-->>Client: 201 Created Note over EventPublisher,EventListener: 트랜잭션 커밋 후 비동기 실행 EventPublisher->>EventListener: @TransactionalEventListener EventListener->>NotificationService: notifyParticipantJoined() NotificationService->>DB: 알림 저장 (다른 참여자들에게)Redis Sorted Set(ZSET) 기반 지연 작업 큐
sequenceDiagram participant PostCreate as 게시글 생성 participant Scheduler as CallvanNotificationScheduler participant Redis as Redis Sorted Set participant CronJob as @Scheduled (매분 실행) participant DB as Database PostCreate->>Scheduler: scheduleNotification(post) Scheduler->>Scheduler: 출발시간 - 30분 계산 Scheduler->>Redis: ZADD (score: timestamp) Note over Redis: Key: callvan:notification:queue<br/>Score: 알림 발송 시각 (epoch) loop 매분마다 CronJob->>Redis: ZRANGEBYSCORE (0, now) Redis-->>CronJob: 발송 시각 도래한 작업들 CronJob->>DB: 참여자들에게 알림 생성 CronJob->>Redis: ZREM (처리 완료된 작업 제거) end콜벤 가입 API 동시성 제어 적용
💬 참고 사항
✅ Checklist (완료 조건)