Skip to content

결제 아키텍처 설계 #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

Merged
merged 1 commit into from
Jan 30, 2025
Merged

결제 아키텍처 설계 #9

merged 1 commit into from
Jan 30, 2025

Conversation

SEONGHUN-95
Copy link
Collaborator

코드 설명

  1. api 모듈에서 paymentRequest 생성, 이후 /{paymentId}로 상태 확인
  2. payment 생성 시 DB 데이터와 Spring event 동시 생성 (트랜잭션)
  3. 이후 PaymentCreatedEventHandler가 "payment-created" kafka 이벤트 발행
  4. 이후 차례대로 FraudDetection -> Coupon -> PointConsumer -> PaymentCompletion consumer를 지나 결제 완료 상태가 됨.

고민 내용

  1. Payment 진행 상태 고민
  • consumer들의 작업 여부들을 boolean으로 column 하나씩 넣을지 아니면 하나만 PaymentStatus만 둘지
  1. 이벤트와 DB의 트랜잭션 문제
  • outbox 패턴 사용시 Debezium 외 해결 방법

@@ -21,6 +21,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'com.mysql:mysql-connector-j:8.3.0'
implementation 'org.mindrot:jbcrypt:0.4'
implementation project(path: ':payment')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
implementation project(path: ':payment')
implementation project(':payment')

Copy link
Collaborator

@f-lab-lyan f-lab-lyan left a comment

Choose a reason for hiding this comment

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

Payment와 API의 의존성을 분리하고, Payment를 별도의 인스턴스로 올리는 부분을 추가하면, 좋을 것 같습니다. 👍

@SEONGHUN-95 SEONGHUN-95 merged commit 10323ee into main Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants