Skip to content
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

통제 불가능한 외부 이미지 서버 문제 대응하기 (base/issue/107 브랜치에서 작업해서 수정) #115

Merged
merged 4 commits into from
Dec 4, 2024

Conversation

oownahcohc
Copy link
Collaborator

@oownahcohc oownahcohc commented Dec 2, 2024

주요 작업 내용

  • 외부 이미지 업로드 요청 CompletableFuture 를 통해 비동기로 처리
    • 비즈니스 로직(게시글 업로드 + 포인트 지급)은 callback 으로 등록
    • HTTP Early Return 으로 사용자에게 빠르게 응답
  • 외부 서버 API call 실패 시 재시도 하지 않도록 설정

실패 시나리오 및 대응 방안

  1. 네트워크 connection-timeout, read-timeout 으로 인한 실패
    • 업로드 요청 재시도 안함
  2. 외부 서버에서 발생한 문제로 인한 실패
    • 그냥 실패 처리
      • CompletableFuture 비동기 처리 이후 콜백 메서드(비즈니스 로직) 실행하지 않고 바로 종료

추가 보완이 필요한 부분

  • HTTP Early Return 메시지 구체화
    • 비동기로 처리되는 작업들의 결과를 실시간으로 클라이언트에게 전송
  • 사용자 재시도 요청 시 멱등성을 보장하기 위한 메커니즘
  • 실패 시나리오 및 대응 방안 추가
    • 네트워크 혼선으로 외부 서버 지연 처리되는 경우 : 우리 서버는 결과를 알지 못하는 상태
    • 비즈니스 로직이 실패하여 TX 가 롤백되는 경우

관련 이슈

oownahcohc and others added 4 commits December 2, 2024 20:28
* feat : 외부 이미지 처리 서버 api 샘플

* feat : random 한 latency 로 이미지 처리 응답하는 image manager

* refactor : ImageManager Qualifier 적용

* feat : 외부 이미지 처리 샘플 api 서버 호출 컴포넌트

* feat : 미션 성공 처리 api v2

* add : 샘플 외부 서버 호출은 auth interceptor 안타도록 제거

* http : 미션 성공 처리 api v2

* feature : 외부 서버에서 사용하는 storage

* feature : 외부 서버 문제 발생 시 던지는 예외 클래스

* add : 외부 서버 storage 저장 로직 추가 및 작업 실패율 10% 가 되도록 수정

* feature : 외부 서버에 잘못된 요청 보냈을 경우 ExternalBadRequestException 발생

* refactor : 외부 API 서버 호출부 변경 및 에러 핸들링

* refactor : 외부 서버 feign call 시 응답 객체 변경
@oownahcohc oownahcohc merged commit 74981e4 into base/issue/107 Dec 4, 2024
1 check passed
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.

1 participant