Merged
Conversation
- MerchantRequest: PG -> 가맹점(클라이언트) - WebhookRequest: PG -> 외부 결제 게이트웨이 (웹훅 요청) - WebhookResponse: 외부 결제 -> PG (웹훅 응답)
- ApplicationEventPublisher 활용 - 트랜잭션과 외부 호출 분리
- ServletConfig에서 서비스 컴포넌트 스캔을 제거하여 중복 빈 등록 방지 - AsyncConfig에 @EnableRetry를 추가하여 결제 재시도 기능 구현
- 결제 취소 DTO 생성 (CancelRequest) - 기존 외부 요청 DTO 수정 (WebhookRequest, WebhookResponse) - Mock 서버 handleCancelData (MockController) 추가
- JSP 뷰 리졸버 설정 - Encoding Filter 설정 - 취소 관련 MockController 수정 -> 메인 스레드 블로킹 - 결제 취소 요청 시 timeout 설정
…to feat-webclient-timeout-retry
- JSP 뷰 리졸버 설정 - Encoding Filter 설정 - 취소 관련 MockController 수정 -> 메인 스레드 블로킹 - 결제 취소 요청 시 timeout 설정
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
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.
✨ 이벤트 기반 비동기 외부 호출 구현
🔎 PR 개요
웹훅 처리 과정에서 외부 서비스 호출을 이벤트 기반 비동기 처리로 분리하여 시스템 안정성과 성능을 개선했습니다. ApplicationEventPublisher를 활용하여 PG 서버 상태 저장 후 가맹점 알림을 비동기로 처리하도록 변경했습니다.
@transactional 내부에서 결제 처리 완료 후 이벤트를 발행하고, 트랜잭션 커밋 후 비동기로 외부 호출을 수행하여 DB 무결성과 외부 호출을 분리했습니다. 또한 Spring이 제공하는 표준 재시도 매커니즘(@recover)를 활용하였습니다.
🔗 연관된 이슈
🔧 주요 변경 사항
📝 참고 사항
🚀 향후 개선 방향