generated from spring-templates/spring-concurrency-thread
-
Notifications
You must be signed in to change notification settings - Fork 1
주문 서버의 관심사 작성 및 주문 API 작성 #9
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
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 주문 서버에 대한 관심사를 작성
🐛 Fix : 오류 수정 ✅ Test : 테스트 코드 추가 1. 클라이언트 주문 요청 API 작성 2. 공통 응답 생성 3. exception handler 생성
✅ Test : 테스트 코드 추가 1. Product 도메인에 재고 확인 기능 추가 클라이언트가 요청한 상품의 재고가 충분한지 확인할 수 있다. 2. 재고 확인 기능의 test 코드 추가
1. 주문 서비스 작성
1. DB 상에서 유형제품과 주문이 연결되긴 하지만 출력에 연결되지 않는 것처럼 보이는 문제 발생
재고 감소 기능 구현 To Do 재고 감소 테스트
🐛 Fix : 한 Transcation에서 생성 확인이 어려운 문제 해결 🤖 Refactor : 메서드 분리
유형제품 제고 확인 테스트 작성
✅ Test : 비관적 락과 낙관적 락을 통해 재고 감소 기능 테스트
To Do paymentId를 리다이렉트할 때 이용해서 결제가 정상적으로 이뤄졌는지 확인하기
To Do 결제 확인 기능 구현 결제 실패 시 롤백 기능 구현
To Do 1. 클라이언트에게 결제 결과 보여주도록 리다이렉트 성공시키기 2. 결제 실패시 롤백하는 로직 작성하기
결제 서버 작성, 결제 응답에 따라 주문 로직 구현 To Do 네임드락을 이용해서 다른 세션에서 같은 락 사용해서 긴 생명 주기 transaction 구현
분산락은 단순히 여러 컴포넌트에서 접근할 수 있는 이름이 있는 락일 뿐 자동 롤백 같은 역할을 하지 않는다. 다만, 여러 컴포넌트가 락을 얻어 동시성 문제를 해결하는데는 도움을 받을 수 있을 것 같다.
To Do 1. 롤백은 되었지만 클라이언트가 리다이렉트해서 받은 결과는 롤백 전 상태를 받는다. 2. 따라서 클라이언트의 세션과 결제 완료 세션은 다른 락을 가지고 DB에 접근해야하고 결제 완료 세션이 우션해야한다.
To Do 1. 결제 실패가 올 때 롤백하고 클라이언트에게 응답할 수 있도록 수정 2. 주문 수량에 상관 없이 일정하게 롤백이 가능하도록 수정
주문 생성과 주문 확정 사이 동시성 문제가 발생했다. 그러나 유저 레벨 락을 이용해서 스레드 안전하게 주문을 조작하게 했다. To Do 1. 나머지 코드 정리 2. 결제가 실패나 성공 아무거나 떠도 안전하게 처리할 수 있도록
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
개요
주문 서버의 관심사
변경 사항
추가 정보