[Resilience4J] MSA ํ™˜๊ฒฝ์—์„œ์˜ ์žฅ์•  ๋ฐฉ์–ด ์ „๋žต

1. CircuitBreaker๊ฐ€ ํ•„์š”ํ•œ ์ด์œ 

๊ฐœ๋ฐœ์„ ํ•˜๋‹ค ๋ณด๋ฉด ์™ธ๋ถ€ API๋ฅผ ํ˜ธ์ถœํ•ด์•ผ ํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‹ค. ํŠนํžˆ๋‚˜ ์ „์ฒด์ ์ธ ์‹œ์Šคํ…œ ๊ตฌ์„ฑ์ด MSA(Microservice Architecture)๋กœ ๋˜์–ด ์žˆ๋‹ค๋ฉด ๋‹ค๋ฅธ ์„œ๋น„์Šค๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งค์šฐ ๋นˆ๋ฒˆํ•˜๋‹ค.

 

๋ฌธ์ œ๋Š” ์„œ๋ฒ„๋“ค์— ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ์ ์ธ๋ฐ, ํ˜ธ์ถœํ•œ ๋‹ค๋ฅธ ์„œ๋น„์Šค์— ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค๋ฉด ์žฅ์• ๊ฐ€ ์ „ํŒŒ๋˜์–ด, ํ•ด๋‹น ์„œ๋น„์Šค๊นŒ์ง€ ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ๋‹ค. ๋˜ํ•œ ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•œ ์„œ๋ฒ„์— ๊ณ„์† ์š”์ฒญ์„ ๋ณด๋‚ด๋Š” ๊ฒƒ์€ ์žฅ์•  ๋ณต๊ตฌ๋ฅผ ํž˜๋“ค๊ฒŒ ๋งŒ๋“ ๋‹ค.

 

 

 

์˜ˆ๋ฅผ ๋“ค์–ด, ์‚ฌ์šฉ์ž์˜ ๋Œ€์‹œ๋ณด๋“œ์—์„œ ํ•œ ๋ฒˆ์˜ ์š”์ฒญ์œผ๋กœ ์‚ฌ์šฉ์ž์˜ ์—ฌ๋Ÿฌ ์ •๋ณด๋ฅผ ์กฐํšŒํ•ด ํ•œ ํ™”๋ฉด์— ๋ณด์—ฌ์ฃผ์–ด์•ผ ํ•˜๋Š” ์ƒํ™ฉ์„ ์ƒ๊ฐํ•ด๋ณด์ž. ์ด ๋Œ€์‹œ๋ณด๋“œ๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ๊ฐ๊ธฐ ๋‹ค๋ฅธ ์„œ๋น„์Šค์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์™€์•ผ ํ•œ๋‹ค.

  1. ์‚ฌ์šฉ์ž ์ •๋ณด ์„œ๋น„์Šค: ์‚ฌ์šฉ์ž ํ”„๋กœํ•„ ์ •๋ณด๋ฅผ ๋ฐ˜ํ™˜
  2. ์ฃผ๋ฌธ ๋‚ด์—ญ ์„œ๋น„์Šค: ์‚ฌ์šฉ์ž์˜ ์ตœ๊ทผ ์ฃผ๋ฌธ ๋‚ด์—ญ์„ ๋ฐ˜ํ™˜
  3. ์ถ”์ฒœ ์„œ๋น„์Šค: ์‚ฌ์šฉ์ž์˜ ๊ด€์‹ฌ์‚ฌ์— ๋งž๋Š” ์ถ”์ฒœ ์ƒํ’ˆ ๋ชฉ๋ก์„ ๋ฐ˜ํ™˜

 

๋งŒ์•ฝ ์ด ์ค‘ ํ•˜๋‚˜์˜ ์„œ๋น„์Šค, ์˜ˆ๋ฅผ ๋“ค์–ด ์ถ”์ฒœ ์„œ๋น„์Šค์— ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค๋ฉด, ๋Œ€์‹œ๋ณด๋“œ ์„œ๋น„์Šค๋Š” ์ถ”์ฒœ ๋ฐ์ดํ„ฐ๋ฅผ ๊ธฐ๋‹ค๋ฆฌ๋ฉด์„œ ์‘๋‹ต์ด ์ง€์—ฐ๋œ๋‹ค. ์ด๋Š” ๋Œ€์‹œ๋ณด๋“œ ์ „์ฒด์˜ ์‘๋‹ต ์†๋„๋ฅผ ๋Šฆ์ถ”๊ฒŒ ๋  ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ, ์ตœ์•…์˜ ๊ฒฝ์šฐ ์žฅ์• ๊ฐ€ ๋‚œ ์„œ๋น„์Šค๋กœ ์ธํ•ด ์ „์ฒด ๋Œ€์‹œ๋ณด๋“œ๊ฐ€ ์‘๋‹ตํ•˜์ง€ ์•Š๋Š” ์ƒํ™ฉ์ด ๋ฐœ์ƒํ•  ์ˆ˜๋„ ์žˆ๋‹ค.

 

 

 

์ด๋ฅผ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•œ ์„œ๋น„์Šค๋ฅผ ํƒ์ง€ํ•˜๊ณ , ์š”์ฒญ์„ ๋ณด๋‚ด์ง€ ์•Š๋„๋ก ์ฐจ๋‹จํ•  ํ•„์š”๊ฐ€ ์žˆ๋‹ค. ์ด๋•Œ ์‚ฌ์šฉ๋˜๋Š” ๊ฒƒ์ด ์„œํ‚ท ๋ธŒ๋ ˆ์ด์ปค์ด๋‹ค.

 

 

 

 

 

 

 

 

 

 

 

2. CircuitBreaker๋ž€?

 

์›๋ž˜ ์„œํ‚ท ๋ธŒ๋ ˆ์ด์ปค๋Š” ํ•ด์„ ๊ทธ๋Œ€๋กœ ๋ˆ„์ „ ์ฐจ๋‹จ๊ธฐ ๋ผ๋Š” ๋œป์„ ์ง€๋‹Œ๋‹ค. ๋ˆ„์ „ ์ฐจ๋‹จ๊ธฐ๋Š” ์ „๊ธฐ ํšŒ๋กœ์—์„œ ๊ณผ๋ถ€ํ•˜๊ฐ€ ๊ฑธ๋ฆฌ๊ฑฐ๋‚˜ ๋‹จ๋ฝ์œผ๋กœ ์ธํ•œ ํ”ผํ•ด๋ฅผ ๋ง‰๊ธฐ ์œ„ํ•ด ์ž๋™์œผ๋กœ ํšŒ๋กœ๋ฅผ ์ •์ง€์‹œํ‚ค๋Š” ์žฅ์น˜์ด๋‹ค.

 

์„œ๋ฒ„์—์„œ ์‚ฌ์šฉํ•˜๋Š” ์„œํ‚ท ๋ธŒ๋ ˆ์ด์ปค๋„ ์™ธ๋ถ€ API ํ†ต์‹ ์˜ ์žฅ์•  ์ „ํŒŒ๋ฅผ ๋ง‰๊ธฐ ์œ„ํ•ด ์žฅ์• ๋ฅผ ํƒ์ง€ํ•˜๋ฉด ์™ธ๋ถ€์™€์˜ ํ†ต์‹ ์„ ์ฐจ๋‹จํ•˜๋Š” ์—ญํ• ์„ ํ•œ๋‹ค.

 

์„œํ‚ท ๋ธŒ๋ ˆ์ด์ปค๊ฐ€ ์‹คํ–‰(์˜คํ”ˆ)๋˜๋ฉด fail-fast ํ•จ์œผ๋กœ์จ ์™ธ๋ถ€ ์„œ๋น„์Šค๊ฐ€ ์žฅ์• ๊ฐ€ ๋‚˜๋”๋ผ๋„ ๋น ๋ฅด๊ฒŒ ์—๋Ÿฌ๋ฅผ ์‘๋‹ต ๋ฐ›์„ ์ˆ˜ ์žˆ๋Š” ์žฅ์ ์ด ์žˆ์œผ๋ฉฐ, ๊ฐœ๋ฐœ์ž๊ฐ€ ์ง€์ •ํ•œ ํ–‰์œ„๋ฅผ ๋ฆฌํ„ด ๋ฐ›์„ ์ˆ˜๋„ ์žˆ๋‹ค. 

 

 

 

 

 

 

 

 

 

 

 

 

3. CircuitBreaker ๋™์ž‘ ์›๋ฆฌ

 

์„œํ‚ท ๋ธŒ๋ ˆ์ด์ปค์˜ 3๊ฐ€์ง€ ์ƒํƒœ

์‹ค์ œ ํšŒ๋กœ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์ „๊ตฌ๊ฐ€ ์™ธ๋ถ€ API ๋˜๋Š” Callee์— ํ•ด๋‹นํ•˜๊ณ , Power Source๊ฐ€ ํด๋ผ์ด์–ธํŠธ(ํ˜ธ์ถœ ์„œ๋ฒ„) ๋˜๋Š” Caller์— ํ•ด๋‹นํ•œ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ํšŒ๋กœ ์ฐจ๋‹จ๊ธฐ์—๋Š” ํฌ๊ฒŒ CLOSED, OPEN, HALF_OPEN 3๊ฐ€์ง€ ์ƒํƒœ๊ฐ€ ์กด์žฌํ•˜๋Š”๋ฐ, ๊ฐ๊ฐ์˜ ์ƒํƒœ๋ฅผ ์ •๋ฆฌํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.  

 

 

  • CLOSED: circuit์ด ๋‹ซํžŒ ์ƒํƒœ๋กœ, ์™ธ๋ถ€ ํ˜ธ์ถœ์ด ์ •์ƒ์ƒํƒœ์ด๋‹ค.
  • OPEN: circuit์ด ์—ด๋ฆฐ ์ƒํƒœ๋กœ, ์˜ค๋ฅ˜(์‹คํŒจํ˜ธ์ถœ/๋Š๋ฆฐํ˜ธ์ถœ)๊ฐ€ ๋ฐœ์ƒํ–ˆ์„ ๋•Œ OPEN ์ƒํƒœ๋กœ ์ „ํ™˜๋œ๋‹ค.
  • HALF_OPEN: OPEN ์ƒํƒœ๊ฐ€ ๋ฐœ์ƒํ•œ ์ดํ›„ ์ผ์ • ์‹œ๊ฐ„์ด ์ง€๋‚œ ์ƒํƒœ์ด๋‹ค. ์ด๋•Œ ์ƒํƒœ๊ฐ€ ์ •์ƒ์ ์ด๋ผ๋ฉด CLOSED๋กœ, ์•„๋‹ˆ๋ผ๋ฉด ๋‹ค์‹œ OPEN์œผ๋กœ ์ „ํ™˜๋œ๋‹ค.

 

 

์„œํ‚ท ๋ธŒ๋ ˆ์ด์ปค์˜ ์Šฌ๋ผ์ด๋”ฉ ์œˆ๋„์šฐ

์Šฌ๋ผ์ด๋”ฉ ์œˆ๋„์šฐ๋Š” ์‹œ๊ฐ„ ๊ธฐ๋ฐ˜(Time-Based)๊ณผ ๊ฐœ์ˆ˜ ๊ธฐ๋ฐ˜(Count-Based)์˜ 2๊ฐ€์ง€ ํƒ€์ž…์„ ๊ฐ–๋Š”๋‹ค.

  • Time-Based: ํŠน์ • ๊ธฐ๊ฐ„(Duration) ์˜ ํ˜ธ์ถœ ๊ฒฐ๊ณผ๋ฅผ ์ €์žฅํ•˜๋Š” ์Šฌ๋ผ์ด๋”ฉ ์œˆ๋„์šฐ๋ฅผ ์ œ๊ณต
  • Count-Based: ํŠน์ • ๊ฐœ์ˆ˜(Count) ์˜ ํ˜ธ์ถœ ๊ฒฐ๊ณผ๋ฅผ ์ €์žฅํ•˜๋Š” ์Šฌ๋ผ์ด๋”ฉ ์œˆ๋„์šฐ๋ฅผ ์ œ๊ณต

 

 

 

์„œํ‚ท ๋ธŒ๋ ˆ์ด์ปค์˜ ๋™์ž‘ ํ”„๋กœ์„ธ์Šค๋Š” ์•„๋ž˜์™€ ๊ฐ™๋‹ค.

 

1. ์ผ๋ฐ˜์ ์œผ๋กœ ์™ธ๋ถ€ ์„œ๋ฒ„๋Š” ์ •์ƒ์ ์œผ๋กœ ์‹คํ–‰ ์ค‘์ด๋ฉฐ, ์„œํ‚ท ๋ธŒ๋ ˆ์ด์ปค๋Š” ๋‹ซํ˜€ ์žˆ์–ด ๋ชจ๋“  ์š”์ฒญ์ด ์ „๋‹ฌ๋˜๊ณ  ์‘๋‹ต์„ ๋ฐ›๋Š”๋‹ค.

 

2. ์™ธ๋ถ€ ์„œ๋ฒ„์— ์žฅ์• ๊ฐ€ ๋ฐœ์ƒํ•˜์—ฌ ์š”์ฒญ์ด ์‹คํŒจํ•˜๊ธฐ ์‹œ์ž‘

 

3. ์š”์ฒญ ์‹คํŒจ๊ฐ€ ๊ธฐ์ค€์น˜๋ฅผ ๋„˜์–ด๊ฐ€๋ฉด ์„œํ‚ท ๋ธŒ๋ ˆ์ด์ปค๊ฐ€ ์—ด๋ฆฌ๊ณ  ๋ชจ๋“  ์š”์ฒญ์ด ์ฆ‰์‹œ ์‹คํŒจํ•œ๋‹ค.

 

4. ์„œํ‚ท ๋ธŒ๋ ˆ์ด์ปค๊ฐ€ ์—ด๋ฆฐ ์ƒํƒœ์—์„  ๋ชจ๋“  ์š”์ฒญ์ด ์™ธ๋ถ€ ์„œ๋ฒ„๋กœ ์ „๋‹ฌ๋˜์ง€ ์•Š๊ณ  ์ฆ‰์‹œ ์—๋Ÿฌor์‘๋‹ต์„ ๋ฐ˜ํ™˜ํ•œ๋‹ค.

 

5. ์™ธ๋ถ€ ์„œ๋ฒ„๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ๋ณต๊ตฌ๋œ๋‹ค.

 

6. ์„œํ‚ท ๋ธŒ๋ ˆ์ด์ปค๊ฐ€ OPEN ์ƒํƒœ๋กœ ์ „ํ™˜๋œ ํ›„ ์„ค์ •ํ•œ ์‹œ๊ฐ„์ด ์ง€๋‚˜๋ฉด HALF_OPEN ์ƒํƒœ๋กœ ๋ณ€๊ฒฝ๋œ๋‹ค. ์ด ์ƒํƒœ์—์„œ ์ผ๋ถ€ ์š”์ฒญ๋งŒ ์™ธ๋ถ€ ์„œ๋ฒ„๋กœ ์ „๋‹ฌํ•˜์—ฌ ์„œ๋ฒ„๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ๋™์ž‘ํ•˜๋Š”์ง€ ํ…Œ์ŠคํŠธํ•œ๋‹ค. 

 

7. HALF_OPEN ์ƒํƒœ์—์„œ ์š”์ฒญ์ด ์„ฑ๊ณตํ•˜๋ฉด, ์„œํ‚ท ๋ธŒ๋ ˆ์ด์ปค๋Š” ๋‹ค์‹œ ๋‹ซํ˜€ ๋ชจ๋“  ์š”์ฒญ์ด ์ •์ƒ์ ์œผ๋กœ ์ „๋‹ฌ๋œ๋‹ค. ๋งŒ์•ฝ ์‹คํŒจํ•˜๋ฉด ๋‹ค์‹œ OPEN ์ƒํƒœ๋กœ ์ „ํ™˜๋œ๋‹ค. 

 

 

 

 

 

 

 

 

 

 

 

 

4. Resilience4J ๋„์ž…

์˜์กด์„ฑ ์ถ”๊ฐ€

// resilience4j
implementation 'org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j'

 

 

 

Resilience4J ์„ค์ •

@Configuration
@RequiredArgsConstructor
@Slf4j
public class Resilience4jConfig {

    private final RetryRegistry retryRegistry;

    @Bean
    public CircuitBreaker circuitBreaker(CircuitBreakerRegistry circuitBreakerRegistry) {
        CircuitBreaker circuitBreaker = circuitBreakerRegistry.circuitBreaker(
                "customCircuitBreaker",
                CircuitBreakerConfig.custom()
                        .failureRateThreshold(50) // ์‹คํŒจ์œจ ๊ธฐ์ค€
                        .slowCallRateThreshold(50) // ๋Š๋ฆฐ ํ˜ธ์ถœ ์‹คํŒจ์œจ
                        .slowCallDurationThreshold(Duration.ofSeconds(3)) // ๋Š๋ฆฐ ํ˜ธ์ถœ ํŒ๋‹จ ๊ธฐ์ค€ ์‹œ๊ฐ„
                        .permittedNumberOfCallsInHalfOpenState(3) // Half-Open ์ƒํƒœ์—์„œ ํ—ˆ์šฉ๋˜๋Š” ํ˜ธ์ถœ ํšŸ์ˆ˜
                        .maxWaitDurationInHalfOpenState(Duration.ofSeconds(3)) // Half-Open ์ƒํƒœ์—์„œ ์ตœ๋Œ€ ๋Œ€๊ธฐ ์‹œ๊ฐ„
                        .slidingWindowType(COUNT_BASED) // ํ˜ธ์ถœ ํšŸ์ˆ˜ ๊ธฐ์ค€์œผ๋กœ ํŒ๋‹จ
                        .slidingWindowSize(10) // ์ตœ๊ทผ 10๋ฒˆ ํ˜ธ์ถœ ๊ธฐ์ค€์œผ๋กœ ์‹คํŒจ์œจ ๊ณ„์‚ฐ
                        .minimumNumberOfCalls(5) // ์ตœ์†Œ ํ˜ธ์ถœ ํšŸ์ˆ˜
                        .waitDurationInOpenState(Duration.ofSeconds(60)) // Open ์ƒํƒœ์—์„œ ๋Œ€๊ธฐ ์‹œ๊ฐ„
                        .build()
        );

        return circuitBreaker;
    }

    @Bean
    public Retry retry() {
        return retryRegistry.retry("customRetry",
                RetryConfig.custom()
                        .maxAttempts(3) // ์ตœ๋Œ€ ์žฌ์‹œ๋„ ํšŸ์ˆ˜
                        .waitDuration(Duration.ofMillis(500)) // ์žฌ์‹œ๋„ ๊ฐ„ ๋Œ€๊ธฐ ์‹œ๊ฐ„
                        .build()
        );
    }
}

 

 

Config๋กœ ์„ค์ •ํ•ด๋„ ๋˜์ง€๋งŒ yml ํŒŒ์ผ์—์„œ ์„ค์ •ํ•ด๋„ ๋œ๋‹ค. 

resilience4j:
  circuitbreaker:
    instances:
      customCircuitBreaker: # Circuit Breaker ์ด๋ฆ„
        failureRateThreshold: 50 # ์‹คํŒจ์œจ ๊ธฐ์ค€
        slowCallRateThreshold: 50 # ๋Š๋ฆฐ ํ˜ธ์ถœ ์‹คํŒจ์œจ
        slowCallDurationThreshold: 3s # ๋Š๋ฆฐ ํ˜ธ์ถœ ํŒ๋‹จ ๊ธฐ์ค€ ์‹œ๊ฐ„
        permittedNumberOfCallsInHalfOpenState: 3 # Half-Open ์ƒํƒœ์—์„œ ํ—ˆ์šฉ๋˜๋Š” ํ˜ธ์ถœ ํšŸ์ˆ˜
        maxWaitDurationInHalfOpenState: 3s # Half-Open ์ƒํƒœ์—์„œ ์ตœ๋Œ€ ๋Œ€๊ธฐ ์‹œ๊ฐ„
        slidingWindowType: COUNT_BASED # ์Šฌ๋ผ์ด๋”ฉ ์œˆ๋„์šฐ ๋ฐฉ์‹: ํ˜ธ์ถœ ํšŸ์ˆ˜ ๊ธฐ์ค€
        slidingWindowSize: 10 # ์ตœ๊ทผ 10๋ฒˆ ํ˜ธ์ถœ ๊ธฐ์ค€์œผ๋กœ ์‹คํŒจ์œจ ๊ณ„์‚ฐ
        minimumNumberOfCalls: 5 # ์ตœ์†Œ ํ˜ธ์ถœ ํšŸ์ˆ˜
        waitDurationInOpenState: 60s # Open ์ƒํƒœ์—์„œ ๋Œ€๊ธฐ ์‹œ๊ฐ„

 

 

 

 

 

๋‚˜๋Š” Micro Service ์ค‘ ํ•˜๋‚˜์ธ member-service๋ฅผ ํ˜ธ์ถœํ•˜๋Š” Feign Client์— CircuitBreaker๋ฅผ ์ ์šฉ์‹œ์ผฐ๋‹ค. 

@FeignClient(name = "member-server")
public interface MemberServerClient {

    @GetMapping("/member-server/api/v1/members/info")
    @CircuitBreaker(name = "customCircuitBreaker", fallbackMethod = "getMemberFallback")
    MemberInfoResponse getMemberInfo();

    // Fallback ๋ฉ”์†Œ๋“œ ์ถ”๊ฐ€
    default MemberInfoResponse getMemberFallback(Throwable throwable) {
        System.out.println("Fallback executed due to: " + throwable.getMessage());
        return new MemberInfoResponse();
    }
}

 

 

Fallback Method๋ž€ Circuit Breaker๊ฐ€ Open ์ƒํƒœ์ผ ๋•Œ ํ˜ธ์ถœ๋˜๋Š” ๋Œ€์ฒด ๋ฉ”์„œ๋“œ์ด๋‹ค. ์›๋ž˜ ํ˜ธ์ถœํ•˜๋ ค๋Š” ๋ฉ”์„œ๋“œ์—์„œ ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ•˜๊ฑฐ๋‚˜ ์™ธ๋ถ€ ์„œ๋น„์Šค๊ฐ€ ์‘๋‹ตํ•˜์ง€ ์•Š์„ ๋•Œ Fallback ๋ฉ”์„œ๋“œ๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ์˜ˆ์™ธ ์ƒํ™ฉ์„ ์ฒ˜๋ฆฌํ•˜๊ณ , ์˜ˆ์™ธ ๋ฐœ์ƒ ์‹œ ์–ด๋–ค ๊ฐ’์„ ๋ฐ˜ํ™˜ํ•  ๊ฑด์ง€์— ๋Œ€ํ•ด์„œ๋„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋‹ค.

 

 

 

 

CircuitBreaker Closed ์ƒํƒœ

member-server์— ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ•˜๋„๋ก ์„ค์ •ํ•˜๊ณ  ์š”์ฒญ์„ ๋ณด๋‚ด๋ณด๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด Fallback Method๊ฐ€ ํ˜ธ์ถœ๋˜๋Š” ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. 

 

 

๋˜ํ•œ ๋นˆ Response ๊ฐ์ฒด๋ฅผ ๋ฐ˜ํ™˜ํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ์‘๋‹ต๊ฐ’์—๋„ null๋กœ ์ฐํžŒ๋‹ค. 

 

 

 

 

๋‹น์—ฐํ•˜๊ฒŒ๋„ member-server์˜ ๋กœ๊ทธ๋ฅผ ํ™•์ธํ•ด๋ณด๋ฉด ์—๋Ÿฌ๊ฐ€ ์ฐํžŒ๋‹ค. 

 

 

 

 

 

CircuitBreaker Open ์ƒํƒœ์ผ ๋•Œ 

๋‚˜๋Š” ์ตœ์†Œ ํ˜ธ์ถœ ํšŸ์ˆ˜๋ฅผ 5๋ฒˆ์œผ๋กœ ์žก์•˜๊ธฐ ๋•Œ๋ฌธ์— 5๋ฒˆ ์—ฐ์† ๋ณด๋‚ด๋ณด๋ฉด  CircuitBreaker๊ฐ€ ์—ด๋ฆฐ๋‹ค.

 

CircuitBreaker๊ฐ€ ์š”์ฒญ์„ ์ฐจ๋‹จํ•˜๊ธฐ ๋•Œ๋ฌธ์— member server์—์„  ๋”์ด์ƒ์˜ ์—๋Ÿฌ ๋กœ๊ทธ๋Š” ์ฐํžˆ์ง€ ์•Š๋Š”๋‹ค.