官术网_书友最值得收藏!

The @CircuitBreaker policy

The @CircuitBreaker annotation can be applied to a class or method. The circuit breaker pattern was introduced by Martin Fowler to protect the execution of an operation by making it fail fast in case of a dysfunction:

@CircuitBreaker(requestVolumeThreshold = 4, failureRatio=0.75, delay = 1000)
public void operationCouldBeShortCircuited(){
...
}

In the previous example, the method applies the CircuitBreaker policy. The circuit will be opened if three (4 x 0.75) failures occur among the rolling window of four consecutive invocations. The circuit will stay open for 1,000 ms and then be back to half-open. After a successful invocation, the circuit will be back to closed again.

主站蜘蛛池模板: 宁夏| 宁南县| 陆丰市| 云南省| 百色市| 饶阳县| 兰西县| 兴隆县| 达拉特旗| 柘城县| 鹤峰县| 巴东县| 靖安县| 武夷山市| 通城县| 安顺市| 普安县| 沙河市| 綦江县| 丹阳市| 广西| 当涂县| 桦甸市| 剑阁县| 尉犁县| 奉新县| 河东区| 新龙县| 广昌县| 静宁县| 白沙| 岳西县| 包头市| 惠来县| 聂拉木县| 石景山区| 双柏县| 剑川县| 贺州市| 台山市| 开远市|