Class: HttpCircuitBreakerConfig
server-http-client/src.HttpCircuitBreakerConfig
Constructors
new HttpCircuitBreakerConfig()
new HttpCircuitBreakerConfig():
HttpCircuitBreakerConfig
Returns
Properties
errorThresholdPercentage
errorThresholdPercentage:
number
=100
Percentage of failed requests that will trip the circuit. The circuit will trip open when the failure rate is equal or greater than this value.
Default
100 (100%), because we want to trip the circuit only if all requests are failing
because there can be dozens of reasons of failure and if there is a chance to get
a successful response we want to try it, unless it dead for everyone
Source
libs/server-http-client/src/lib/config/http-circuit-breaker.config.ts:33
maxConcurrentRequests
maxConcurrentRequests?:
number
The number of concurrent requests allowed. If the number currently executing requests is equal to maxConcurrentRequests, further calls are rejected until at least one of the current requests completes.
Default
not limited
Source
libs/server-http-client/src/lib/config/http-circuit-breaker.config.ts:64
resetTimeout
resetTimeout:
number
=30_000
The time in milliseconds to wait before setting the breaker to halfOpen
state, and trying the action again.
In other words, how long should we give an external service to recover
before we will continue making requests to it again
Default
30000 (30 seconds)
Source
libs/server-http-client/src/lib/config/http-circuit-breaker.config.ts:22
rollingCountTimeout
rollingCountTimeout:
number
=10_000
Sets the duration of the statistical rolling window, in milliseconds. This is how long we keep metrics for the circuit breaker to use and for publishing.
Default
10000 (10 seconds)
Source
libs/server-http-client/src/lib/config/http-circuit-breaker.config.ts:42
timeout
timeout:
number
=10_000
The max number of milliseconds allowed for the external service to respond to a request before the breaker considers it a failure.
Default
10000 (10 seconds)
Source
libs/server-http-client/src/lib/config/http-circuit-breaker.config.ts:12
volumeThreshold
volumeThreshold:
number
=30
The minimum number of requests within the rolling statistical window that must exist before the circuit breaker can open. if the number of requests within the statistical window does not exceed this threshold, the circuit will remain closed.
Default
0
Source
libs/server-http-client/src/lib/config/http-circuit-breaker.config.ts:53
Generated using typedoc-plugin-markdown and TypeDoc