Skip to content

221 feat: EventBridge maintenance direct invoke 전환 - #223

Merged
pp8817 merged 5 commits into
devfrom
feat/221
Apr 28, 2026
Merged

221 feat: EventBridge maintenance direct invoke 전환#223
pp8817 merged 5 commits into
devfrom
feat/221

Conversation

@pp8817

@pp8817 pp8817 commented Apr 26, 2026

Copy link
Copy Markdown
Member

참고 사항

백엔드 Lambda 내부 @Scheduled 유지보수 작업을 EventBridge Scheduler direct invoke 방식으로 전환하기 위한 백엔드 코드 변경입니다.

주요 변경 사항:

  • EventBridge Scheduler payload를 StreamLambdaHandler에서 감지해 maintenance task로 분기
  • SCRAPE_JOB_RECONCILE_STALE, REFRESH_TOKEN_CLEANUP task 라우팅 추가
  • stale scrape job reconcile과 refresh token cleanup의 내부 @Scheduled 의존 제거
  • scraping.scheduler.enabled 기본값을 false로 변경
  • Lambda direct invoke / 기존 HTTP proxy 경로 회귀 테스트 추가

검증:

  • ./gradlew test
  • ./gradlew build

인프라 후속 작업:

  • EventBridge Scheduler 2개 생성
  • Scheduler role에 Backend Lambda invoke 권한 부여
  • Backend Lambda resource permission 추가
  • SCRAPING_SCHEDULER_ENABLED=false 명시

🔗 Related Issue

Closes #221

@pp8817
pp8817 requested a review from hoooonshub as a code owner April 26, 2026 04:33

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates maintenance tasks, such as stale job reconciliation and refresh token cleanup, from internal @scheduled annotations to direct AWS Lambda invocations triggered by EventBridge Scheduler. The implementation introduces a MaintenanceTaskHandler to route these events and updates StreamLambdaHandler to distinguish between HTTP and maintenance payloads. Review feedback identifies a potential compilation error regarding Jackson's JsonNode API, suggests optimizing JSON parsing to avoid redundant processing, and recommends using a static map for more efficient enum lookups.

Comment thread src/main/java/com/chukchuk/haksa/global/lambda/StreamLambdaHandler.java Outdated
@pp8817 pp8817 self-assigned this Apr 27, 2026

@hoooonshub hoooonshub left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했어!

핸들러 분리하는 것보다 하나의 핸들러에서 아예 분기되는 게 더 단순하고 편하다고 판단해서 하나의 핸들러에서 http랑 schedular 처리 다 하는거야?

@pp8817

pp8817 commented Apr 27, 2026

Copy link
Copy Markdown
Member Author

핸들러 분리하는 것보다 하나의 핸들러에서 아예 분기되는 게 더 단순하고 편하다고 판단해서 하나의 핸들러에서 http랑 schedular 처리 다 하는거야?

네 맞아요
다만 핸들러 하나에 모든 로직을 넣은 건 아니고, 진입점은 라우팅만 담당합니다. HTTP는 기존 Spring handler로 넘기고, scheduler event는 maintenance task handler로 넘겨서 실제 처리 책임은 분리했습니다.

Base automatically changed from feat/218 to dev April 28, 2026 02:49
@pp8817
pp8817 merged commit 1b9b580 into dev Apr 28, 2026
2 checks passed
@pp8817
pp8817 deleted the feat/221 branch April 28, 2026 02:49
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.

내부 스케줄링 작업 AWS EventBridge Scheduler로 이전

2 participants