Interface CircuitBreakerConfig

interface CircuitBreakerConfig {
    halfOpenAfter: number;
    methods?: string[];
    openAfterFailedAttempts: number;
    statusCodes?: number[];
    triggerOnNetworkError?: boolean;
    triggerOnTimeout?: boolean;
}

Properties

halfOpenAfter: number

How long to wait before sending a request again after the circuit breaker opened.

methods?: string[]

HTTP methods considered for opening the circuit breaker. Note that all requests will be blocked, once the circuit breaker is open. Default: all

openAfterFailedAttempts: number
statusCodes?: number[]

HTTP status codes that are counted as failed attempts for the circuit breaker. Default: [408, 420, 429, 500, 502, 503, 504]

triggerOnNetworkError?: boolean

Default: true

triggerOnTimeout?: boolean

Default: true