Switch defaults of open and reset timeouts

This commit is contained in:
Dave Syer
2016-08-23 17:19:07 +01:00
parent 6c4d279546
commit 9834a08020
2 changed files with 6 additions and 6 deletions

View File

@@ -75,17 +75,17 @@ public @interface CircuitBreaker {
* to give the downstream component a chance to respond again.
*
* @return the timeout before an open circuit is reset in milliseconds, defaults to
* 5000
* 20000
*/
long resetTimeout() default 5000;
long resetTimeout() default 20000;
/**
* When {@link #maxAttempts()} failures are reached within this timeout, the circuit
* is opened automatically, preventing access to the downstream component.
*
* @return the timeout before an closed circuit is opened in milliseconds, defaults to
* 20000
* 5000
*/
long openTimeout() default 20000;
long openTimeout() default 5000;
}

View File

@@ -31,8 +31,8 @@ public class CircuitBreakerRetryPolicy implements RetryPolicy {
private static Log logger = LogFactory.getLog(CircuitBreakerRetryPolicy.class);
private final RetryPolicy delegate;
private long resetTimeout = 5000;
private long openTimeout = 20000;
private long resetTimeout = 20000;
private long openTimeout = 5000;
public CircuitBreakerRetryPolicy(RetryPolicy delegate) {
this.delegate = delegate;