java Resilience4j从CLOSED直接进入HALF_OPEN,而不进入OPEN

camsedfj  于 2023-08-01  发布在  Java
关注(0)|答案(1)|浏览(121)

在使用resilience4j的断路器设置中,断路器直接从CLOSED变为HALF_OPEN,而不变为OPEN。不仅如此,当我们没有向它提供成功或失败的度量时,就会发生这种情况。这里有两件事不清楚:
1.断路器在没有提供成功或失败的指标时如何改变其状态?
1.断路器从CLOSED到HALF_OPEN的行为是什么,因为理论上它必须从CLOSED到OPEN,然后在等待期后再到HALF_OPEN?

njthzxwz

njthzxwz1#

1. If no metrics provided, CB uses timeout mechanism to change its state. The circuit breaker uses fixed timeout value for each request on its own. If the external service call takes more time than the timeout value(example 100ms for each request) for responding, then it moves to OPEN after tripping.
 2. One possibility is if Retry is used in circuit breaker implementation. CB transition from CLOSED to HALF OPEN directly instead of OPEN due to retry logic to handle failure calls.

字符串

相关问题