Refactor/338 : Redis와 상호작용 모듈화, ACK 시점 변경, 문제 출제 실패 시 메시지 삭제 추가#421
Refactor/338 : Redis와 상호작용 모듈화, ACK 시점 변경, 문제 출제 실패 시 메시지 삭제 추가#421
Conversation
…o refactor/338
…o refactor/338
…o refactor/338
|
Caution Review failedThe pull request is closed. WalkthroughRedisStreamsClient abstraction is added and wired via RedisStreamsConfig. Multiple components (reader, writer, aspect, processor) are refactored to use it for read/ack/delete/DLQ. Mail sending rate-limiter API changes from getBucket() to tryConsume(). MailStatus enum gains QUIZ_FAILED. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant RS as RedisStreamsClient
participant R as RedisStreamReader
participant C as MailConsumerAsyncProcessor
participant W as MailWriter
participant DLQ as DLQ Stream
R->>RS: readWithConsumerGroup(blockTimeout)
alt message available
RS-->>R: MapRecord (recordId, payload)
R->>R: mailSenderContext.tryConsume(strategyKey, 1)
alt rate-limit ok
R-->>C: Subscription + recordId
C->>C: getTodayQuizBySubscription()
alt QuizException
C->>RS: ackAndDel(recordId)
C-->>W: null (skip)
else Success
C-->>W: MailDto(recordId, quiz)
W->>W: sendMail()
opt finally
W->>RS: ackAndDel(recordId)
end
end
else throttled
R-->>C: null (skip)
end
else none
RS-->>R: null
end
note over C,DLQ: On send failure in MailLogAspect, enqueue retry via redisClient.addDlq(...)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (11)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
🔎 작업 내용
🛠️ 변경 사항
Summary by CodeRabbit