Search in sources :

Example 1 with Failover

use of io.gravitee.definition.model.Failover in project gravitee-gateway by gravitee-io.

the class FailoverInvoker method afterPropertiesSet.

@Override
public void afterPropertiesSet() throws Exception {
    Failover failover = api.getProxy().getFailover();
    circuitBreaker = CircuitBreaker.create("cb-" + api.getId(), vertx, new CircuitBreakerOptions().setMaxRetries(// number of failure before opening the circuit
    failover.getMaxAttempts()).setTimeout(// consider a failure if the operation does not succeed in time
    failover.getRetryTimeout()).setResetTimeout(// time spent in open state before attempting to re-try
    10000L).setNotificationAddress(null));
}
Also used : Failover(io.gravitee.definition.model.Failover) CircuitBreakerOptions(io.vertx.circuitbreaker.CircuitBreakerOptions)

Aggregations

Failover (io.gravitee.definition.model.Failover)1 CircuitBreakerOptions (io.vertx.circuitbreaker.CircuitBreakerOptions)1