[DABOM-408] usage-events 중복 처리 방지 로직 추가#49
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 풀 리퀘스트는 앱 차단 정책에 따라 특정 유저가 차단된 앱에서 데이터 사용을 시도할 때 발생할 수 있는 usage-events의 중복 처리를 방지하는 데 중점을 둡니다. Redis Lua 스크립트 내에서 중복 검사 및 사용량 반영을 원자적으로 처리하여 데이터 무결성을 강화하고, 중복 이벤트로 인한 불필요한 리소스 사용 및 후속 이벤트 발행을 방지합니다. 이는 시스템의 안정성과 효율성을 높이는 데 기여합니다. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
SonarQube Quality Summary (Community)❌ Quality Gate FAILED Branch: Issues
Measures
🔗 Dashboard: https://sonarqube.swthewhite.store/dashboard?id=dabom-processor-usage&branch=feat/DABOM-408 Generated automatically by GitHub Actions. |
There was a problem hiding this comment.
Code Review
The pull request implements a Kafka usage event deduplication mechanism using Redis. The UsageSyncServiceImpl now passes a deduplication key and TTL to a Redis Lua script. If the Lua script identifies an event as a duplicate, the service logs the event, increments a Kafka deduplication hit metric, and skips further processing. The UsageUpdateResult DTO was extended with a duplicate flag, and the usage_update.lua script was updated to perform the deduplication check using Redis's SET NX EX command. A review comment suggests optimizing the Lua script by immediately returning fixed values upon detecting a duplicate, rather than performing unnecessary Redis lookups for currentMonthly and monthlyLimit, as these detailed values are not utilized by the Java code for duplicate events.
SonarQube Quality Summary (Community)✅ Quality Gate PASSED Branch: Issues
Measures
🔗 Dashboard: https://sonarqube.swthewhite.store/dashboard?id=dabom-processor-usage&branch=feat/DABOM-408 Generated automatically by GitHub Actions. |
🍀 이슈 & 티켓 넘버
🎯 목적
앱 차단 정책에 따라 특정 유저가 차단된 앱에서 데이터 사용을 시도할 때, 해당 사용량을 차단하는 로직이 필요
📝 변경 사항
📂 변경 범위
🖥️ 주요 코드 설명
💬 리뷰어에게
📋 체크리스트
기본
./gradlew build가 정상적으로 통과하는가?./gradlew spotlessApply checkstyleMain)코드 품질
Controller → Service → Repository → Entity)@Transactional은 Service에만 선언했는가?테스트
📌 참고 사항