Skip to content

fix: Slack 큐 메시지 전송 실패 시 retry 메커니즘 추가#253

Merged
dongmin0204 merged 1 commit into
developfrom
fix/h10-slack-queue-retry
Jul 6, 2026
Merged

fix: Slack 큐 메시지 전송 실패 시 retry 메커니즘 추가#253
dongmin0204 merged 1 commit into
developfrom
fix/h10-slack-queue-retry

Conversation

@yoon6yo

@yoon6yo yoon6yo commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

관련 이슈

변경 사항

SlackMessageDto.java — retryCount 필드 추가

Jackson 직렬화/역직렬화에 대응하여 재시도 횟수를 메시지에 포함시킵니다.

@Builder.Default
private int retryCount = 0;

public void incrementRetryCount() { this.retryCount++; }

SlackNotificationWorker.java — retry 로직 추가

전송 실패 유형에 따라 재시도 여부를 결정합니다.

실패 유형 처리 방식
일시적 오류 (네트워크, Slack 다운 등) 큐에 재삽입, 최대 3회 재시도
BusinessException (유저 없음 등 영구 실패) 즉시 폐기
역직렬화 실패 즉시 폐기 (큐 blocking 방지)
최대 재시도 초과 에러 로그 후 폐기

JVM crash 시나리오: leftPop 후 JVM이 죽으면 메시지는 여전히 유실됩니다.
완전한 at-least-once 보장을 위해서는 Redis의 LMOVE + processing list 패턴이 필요하나,
현재는 Slack 일시 장애 케이스(가장 빈번한 실패 원인)에 대한 retry를 우선 적용합니다.

테스트

  • 기존 테스트 전체 통과 확인 (./gradlew test)

🤖 Generated with Claude Code

- [H-10] SlackNotificationWorker: 전송 실패 시 최대 3회 재시도 후 폐기
  - 일시적 장애(네트워크, Slack API 다운): requeue → 재시도
  - BusinessException(유저 없음 등 영구 실패): 즉시 폐기
- SlackMessageDto: retryCount 필드 추가 (Jackson 직렬화 호환)
  역직렬화 실패 시 명시적 로그 후 폐기하여 큐 blocking 방지

Closes #249

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8f3dd59b-4709-40d5-87de-d198063de7c1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/h10-slack-queue-retry

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dongmin0204 dongmin0204 merged commit 06d6d09 into develop Jul 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[H-10] Slack 큐 메시지 처리 실패 시 유실 (retry 메커니즘 없음)

2 participants