<clean-up> Queue : Cleaning up deprecated DB-related implementation#40
Conversation
📝 WalkthroughWalkthroughThe pull request removes database-backed queue persistence infrastructure, including the QueueRepository domain interface, TokenJpaRepository JPA repository, TokenJpaEntity JPA entity, and TokenRepositoryDbImpl DB implementation class. Configuration files are updated to remove explicit queue provider settings. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~55 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/main/java/com/slam/concertreservation/infrastructure/persistence/redis/impl/TokenRepositoryRedisImpl.java (2)
320-323:⚠️ Potential issue | 🟡 MinorPotential NPE:
waitingTokenCountis not null-checked unlikecountCurrentlyActiveTokens.
ZSetOperations.size()can returnnull(e.g., key doesn't exist yet). Line 225 already guards against this for the analogousactiveTokenCount, but here the rawLongis dereferenced directly.Proposed fix
public int countCurrentlyWaitingTokens(Long concertScheduleId) { Long waitingTokenCount = tokenScoredSortedSet.size(getTokenRankSortedSetName(concertScheduleId)); - return waitingTokenCount.intValue(); + return waitingTokenCount != null ? waitingTokenCount.intValue() : 0; }
277-281:⚠️ Potential issue | 🟡 MinorPotential NPE:
tokenmay benullif the hash entry was removed betweenscanandget.Between the cursor yielding a token ID and the subsequent
HashOperations.get, the entry could have been evicted (TTL, concurrent expiration). A null guard before accessingtoken.getExpiredAt()would prevent a runtime NPE.Proposed fix
Token token = tokenHashStorage.get(getTokenHashStorageName(concertScheduleId), tokenId); - if (token.getExpiredAt() != null && token.getExpiredAt().isBefore(now)) { + if (token != null && token.getExpiredAt() != null && token.getExpiredAt().isBefore(now)) { toBeExpiredActivatedTokens.add(token); }
Queue 도메인 DB 구현체 제거 및 Redis 단일 구현체 전환 (Remove Queue Domain DB Implementation and Switch to Redis Only)
작업 내용
Korean
개요
Queue 도메인의 대기열 처리 로직이 Redis로 완전히 이관됨에 따라, 더 이상 사용하지 않는 JPA 기반의 DB 구현체를 제거했습니다.
작업 이유
주요 변경 사항
TokenJpaEntity,TokenJpaRepository,TokenRepositoryDbImpl,QueueRepository삭제.@ConditionalOnProperty제거).app.queue.provider설정 제거.English
Overview
As the queue processing logic for the Queue domain has been fully migrated to Redis, I have removed the now unused JPA-based DB implementation.
Reason for Change
Key Changes
TokenJpaEntity,TokenJpaRepository,TokenRepositoryDbImpl, andQueueRepository.@ConditionalOnProperty).app.queue.providerconfiguration from application.yml and application-test.yml.QueueServiceUnitTestfunction correctly in the Redis environment.Summary by CodeRabbit