-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 주문서 만료 시 COMPLETED 여부 확인 & 결제 완료 시 Redis 주문서 정보 삭제 #229
Conversation
…nto feature/215
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"BUNSANLOCKKINGGOD재휘님을 만나 내 인생이 달라졌다..."
분산락 이게 머지? ......
.
.
.
.
.
.
.
....
MERGE !
src/main/java/com/woowacamp/soolsool/core/receipt/service/ReceiptService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/woowacamp/soolsool/core/payment/service/PayService.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
분산 락을 안 써도 동시성을 해결할 수 있는 부분들 코멘트로 남겼습니다!
src/main/java/com/woowacamp/soolsool/core/payment/service/PayService.java
Show resolved
Hide resolved
src/main/java/com/woowacamp/soolsool/core/receipt/service/ReceiptService.java
Outdated
Show resolved
Hide resolved
...ain/java/com/woowacamp/soolsool/core/receipt/event/listener/ReceiptExpiredEventListener.java
Outdated
Show resolved
Hide resolved
...ain/java/com/woowacamp/soolsool/core/receipt/repository/redisson/ReceiptRedisRepository.java
Show resolved
Hide resolved
src/main/java/com/woowacamp/soolsool/core/receipt/service/ReceiptService.java
Show resolved
Hide resolved
src/main/java/com/woowacamp/soolsool/core/receipt/service/ReceiptService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
일단 재고 관련 코멘트 빼고 코멘트 달았습니다. 확인해주세요!
src/main/java/com/woowacamp/soolsool/core/receipt/service/ReceiptService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/woowacamp/soolsool/core/receipt/service/ReceiptService.java
Show resolved
Hide resolved
src/main/java/com/woowacamp/soolsool/core/receipt/service/ReceiptService.java
Outdated
Show resolved
Hide resolved
src/main/java/com/woowacamp/soolsool/core/receipt/service/ReceiptService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와오고심히 생각한게 느껴집니다~~~~
src/main/java/com/woowacamp/soolsool/core/payment/service/PayService.java
Show resolved
Hide resolved
…nto feature/215
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다. 저는 단순한 UPDATE 정도는 JPQL로 처리해도 이해하기 쉽다고 생각했습니다.
분산 락을 너무 과하게 쓰고 있는 건 아닐까? 하는 노파심에 남긴 코멘트였는데, 다른 분들의 의견도 궁금합니다.
♻️ 변경 사항
📌 참고 사항
처음에는 주문서 만료 이벤트 발생 시 COMPLETED가 아닌 것만 만료시키자는 생각을 했습니다.
그런데 이미 결제 완료된 주문서까지 매번 만료 이벤트를 발생시킬 필요가 있을까? 하는 생각이 들어서, 결제 완료 이후 Redis에서 주문서 정보를 삭제하는 로직도 추가했습니다.
요약하자면, 일반적인 경우 결제 완료 후 Redis에서 주문서 정보를 삭제합니다.
그러나 { 결제 완료 -> (비동기 이벤트) 주문서 정보 삭제 } 로직 사이에 만료 이벤트가 발생할 수 있기 때문에, 만료 이벤트가 발생했을 경우 COMPLETED 상태가 아닌지 확인하고 해당 주문서를 만료시킵니다.
발행해야 할 이슈
비동기 이벤트 큐 관련 설정 (발행 완료)
🎸 기타
closes #215