Repository navigation
667-deleteAll outbox 스케줄러 추가 #668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
The head ref may contain hidden characters: "667-outbox-\uD14C\uC774\uBE14-\uB370\uC774\uD130-\uC0AD\uC81C-\uC2A4\uCF00\uC904\uB7EC-\uAC1C\uBC1C"
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
5 changes: 5 additions & 0 deletions
5
src/main/kotlin/dsm/pick2024/domain/outbox/port/out/DeleteOutboxPort.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package dsm.pick2024.domain.outbox.port.out | ||
|
|
||
| interface DeleteOutboxPort { | ||
| fun deleteAll() | ||
| } |
3 changes: 2 additions & 1 deletion
3
src/main/kotlin/dsm/pick2024/domain/outbox/port/out/OutboxPort.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| package dsm.pick2024.domain.outbox.port.out | ||
|
|
||
| interface OutboxPort : | ||
| SaveOutboxPort | ||
| SaveOutboxPort, | ||
| DeleteOutboxPort |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
전체 삭제 스케줄은 미처리 outbox 이벤트 유실 위험이 큽니다.
Line 91에서 매일
deleteAll()을 호출하면 아직 발행되지 않은 레코드까지 제거될 수 있습니다. 정리 대상은 최소한발행 완료 + 보관기간 경과조건으로 제한해야 합니다.수정 방향 예시
`@Scheduled`(cron = "0 59 23 * * ?", zone = "Asia/Seoul") fun cleanOutbox() { - deleteOutboxPort.deleteAll() + deleteOutboxPort.deletePublishedBefore( + cutoff = LocalDateTime.now(ZoneId.of("Asia/Seoul")).minusDays(1) + ) }🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 스케줄은 서비스 정책을 고려한 의도적인 동작입니다. 서비스는 20:30 이후에는 신규 이벤트가 생성되지 않으며, 날짜가 지난 이벤트가 뒤늦게 전송될 경우 오히려 사용자 혼선을 유발할 가능성이 더 크다고 판단했습니다.
따라서 outbox 데이터는 매일 종료 시점에 전체 정리하도록 구현했으며, 미전송 이벤트가 일부 제거될 가능성은 서비스 정책상 허용 가능한 trade-off로 보고 있습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ByunDohwi, 설명 감사합니다. 서비스 정책상 20:30 이후 신규 이벤트가 생성되지 않으며, 날짜 경과 이벤트의 지연 전송이 오히려 사용자 혼선을 유발할 수 있다는 맥락을 이해했습니다. 해당 trade-off를 명시적으로 판단하신 것이므로 기존 구현 방식을 유지하는 것이 합리적입니다. 지적을 철회하겠습니다.🐇 ~(=^‥^)/
✏️ Learnings added