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

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.

主站蜘蛛池模板: 五河县| 政和县| 湖州市| 休宁县| 仪征市| 古田县| 瑞金市| 遂川县| 蒙城县| 兴义市| 中方县| 宁波市| 娱乐| 津市市| 东海县| 孝昌县| 伽师县| 兴安县| 介休市| 禄丰县| 嵊泗县| 新丰县| 称多县| 铁岭县| 邳州市| 遵义市| 贡觉县| 文安县| 四川省| 久治县| 阳城县| 房山区| 衡水市| 青海省| 江源县| 黑山县| 无棣县| 老河口市| 九龙城区| 浙江省| 涞水县|