You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ This library is a Simple Circuit Breaker for JAVA 7 and above. It is directly in
5
5
It supports the 5 states:
6
6
- OPEN
7
7
- CLOSED
8
-
-HALF-OPEN
8
+
-HALF_OPEN
9
9
- DISABLED: broker is always closed (via property slidingWindowSize)
10
10
- FORCED_OPEN: broker is always opened (via property slidingWindowSize)
11
11
@@ -24,7 +24,7 @@ maxDurationOpenInHalfOpenState is a new property described in the sample code pa
24
24
| slidingWindowSize | 100 [s]| 0 to set breaker in DISABLED state, -1 to set breaker in FORCED_OPEN state |
25
25
| minimumNumberOfCalls | 10 ||
26
26
| waitDurationInOpenState | 60000 [ms]||
27
-
| maxDurationOpenInHalfOpenState | 120000 [ms]| If set to 0, there is no limit|
27
+
| maxDurationOpenInHalfOpenState | 120000 [ms]| If set to 0, the breaker in HALF_OPEN state will wait forever for the outcome (fail or success) of all the permittedNumberOfCallsInHalfOpenState calls|
28
28
29
29
30
30
## Sample Code
@@ -43,9 +43,9 @@ loop
43
43
circuitBreaker.callFailed(doSomething duration);
44
44
```
45
45
46
-
**Important**: `callSucceeded()` or `callFailed()` must always be invoked after `isClosedForThisCall()`. Otherwise breaker in HALF-OPEN state will never move to another state, waiting for the results of the permittedNumberOfCallsInHalfOpenState calls.
46
+
**Important**: `callSucceeded()` or `callFailed()` must always be invoked after `isClosedForThisCall()`. Otherwise breaker in HALF_OPEN state will never move to another state, waiting for the results of the permittedNumberOfCallsInHalfOpenState calls.
47
47
48
-
To avoid this situation a new property called maxDurationOpenInHalfOpenState is introduced. In HALF-OPEN state, after permittedNumberOfCallsInHalfOpenState calls (`isClosedForThisCall()` returns true), all its subsequent calls (`isClosedForThisCall()` returns false) should not be executed as the circuit is opened. If this situation lasts longer than maxDurationOpenInHalfOpenState ms, the breaker goes back automatically to the CLOSED state.
48
+
To avoid this situation a new property called maxDurationOpenInHalfOpenState is introduced. In HALF_OPEN state, after permittedNumberOfCallsInHalfOpenState calls (`isClosedForThisCall()` returns true), all its subsequent calls (`isClosedForThisCall()` returns false) should not be executed as the circuit is opened. If this situation lasts longer than maxDurationOpenInHalfOpenState ms, the breaker goes back automatically to the CLOSED state.
49
49
50
50
## Circuit Breaker Configuration using Properties
51
51
The circuit breaker can easily be configured using `java.util.Properties`, possibly adding prefix, for example:
0 commit comments