Skip to content

feat: Notification 배치 저장 로직 추가#2265

Merged
Soundbar91 merged 4 commits into
developfrom
feat/2264-add-notification-save-batch
May 24, 2026
Merged

feat: Notification 배치 저장 로직 추가#2265
Soundbar91 merged 4 commits into
developfrom
feat/2264-add-notification-save-batch

Conversation

@Soundbar91
Copy link
Copy Markdown
Collaborator

🔍 개요


🚀 주요 변경 내용

NotificationJdbcRepository 클래스 추가

  • jpa의 saveAll 메소드의 경우 N개를 저장한다고 가정을 하면 insert 쿼리를 N개를 호출했습니다.
  • 키워드 기능에서 평균 50개의 단일 insert 쿼리가 발생하고 있습니다.
  • 이를 한 번에 insert 하고자 jdbctemplate를 활용하여 배치처리를 할 수 있도록 클래스를 추가했습니다.

💬 참고 사항


✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

@Soundbar91 Soundbar91 self-assigned this May 22, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

Warning

Review limit reached

@Soundbar91, we couldn't start this review because you've used your available PR reviews for now.

Your plan currently allows 1 review/hour. Refill in 19 minutes and 58 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cea6f5c8-df26-4ef9-a736-5e576fc262c7

📥 Commits

Reviewing files that changed from the base of the PR and between e4c5122 and 94b9215.

📒 Files selected for processing (3)
  • src/main/java/in/koreatech/koin/domain/notification/repository/NotificationJdbcRepository.java
  • src/main/java/in/koreatech/koin/domain/notification/service/NotificationService.java
  • src/test/java/in/koreatech/koin/unit/domain/notification/service/NotificationServiceTest.java
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/2264-add-notification-save-batch

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 and usage tips.

@github-actions github-actions Bot added the 공통 백엔드 공통으로 작업할 이슈입니다. label May 22, 2026
@github-actions github-actions Bot requested review from DHkimgit and kih1015 May 22, 2026 08:16
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

Unit Test Results

672 tests   669 ✔️  1m 19s ⏱️
166 suites      3 💤
166 files        0

Results for commit 94b9215.

♻️ This comment has been updated with latest results.

Comment on lines +53 to +61
notifications.forEach(notification -> fcmClient.sendMessage(
notification.getUser().getDeviceToken(),
notification.getTitle(),
notification.getMessage(),
notification.getImageUrl(),
notification.getMobileAppPath(),
notification.getSchemeUri(),
notification.getType().toLowerCase()
));
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.

runAfterCommit(() -> notifications.forEach(this::sendNotificationSafely))로 하면, DB 커밋 실패해도 전송되는 문제를 막을 수 있습니다

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

해당 부분은 NotificationService 코드 리펙토링을 별도로 진행하면서 재적용할 예정입니당

… feat/2264-add-notification-save-batch

# Conflicts:
#	src/main/java/in/koreatech/koin/domain/notification/service/NotificationService.java
@Soundbar91 Soundbar91 merged commit 9d016ef into develop May 24, 2026
6 checks passed
@Soundbar91 Soundbar91 deleted the feat/2264-add-notification-save-batch branch May 24, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

공통 백엔드 공통으로 작업할 이슈입니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[공통] Notification 배치 저장 로직 추가

2 participants