Skip to content

Conversation

@vumrra
Copy link
Contributor

@vumrra vumrra commented Apr 21, 2025

개요

매치 검색시 사용하는 배팅 정보 일괄 조회 internal API client에서 오류 발생시 fallback 처리와 circuitbreaker를 적용하였습니다.

본문

  • 매치 검색시 Betting Service에 동기 HTTP 요청을 하게 되는데 요청하는 서비스에서 장애 발생시 매치 검색도 되지 않는 장애 전파 문제 있습니다.
  • internal API 요청중 문제 발생시 fallback 메서드를 실행하도록 하였고, 아래의 설정에 의해 임계치 이상 실패시 circuitbreaker가 OPEN 되도록하여 장애 발생 서비스를 격리시킵니다.
resilience4j:
  circuitbreaker:
    configs:
      default:
        failure-rate-threshold: 50
        slow-call-rate-threshold: 80
        slow-call-duration-threshold: 5s
        permitted-number-of-calls-in-half-open-state: 3
        max-wait-duration-in-half-open-state: 0
        sliding-window-type: COUNT_BASED
        sliding-window-size: 20
        minimum-number-of-calls: 10
        wait-duration-in-open-state: 15s

추가사항

  • 헬스체크 인디게이터 빈 등록 관련 문제가 발생하여 enable 설정을 application.yml에서 제거하였습니다.
  • fallback과 circuitbreaker는 다른 개념입니다.
    circuitbreaker -> 장애 서비스 API 요청 자체를 막음, fallback -> API 에러 발생시 미리 설정해둔 기본 값 반환

@vumrra vumrra requested a review from Umjiseung April 21, 2025 11:47
@vumrra vumrra self-assigned this Apr 21, 2025
Copy link
Member

@Umjiseung Umjiseung left a comment

Choose a reason for hiding this comment

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

서킷 브레이커~

@vumrra
Copy link
Contributor Author

vumrra commented Apr 21, 2025

네..

@vumrra vumrra merged commit f204359 into develop Apr 21, 2025
1 check passed
@vumrra vumrra mentioned this pull request Apr 23, 2025
@vumrra vumrra changed the title add: match search - betting bundle feign client fallaback, circuirbre… [match] 매치 검색 API fallback, circuitbreaker 전략 적용 Apr 23, 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.

3 participants