Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setTimeout is not work #38

Open
buiminhhuy opened this issue Nov 14, 2019 · 0 comments
Open

setTimeout is not work #38

buiminhhuy opened this issue Nov 14, 2019 · 0 comments

Comments

@buiminhhuy
Copy link

buiminhhuy commented Nov 14, 2019

Hi Team
Help check option setTimeout, It is seem to me not work. I implemented on vertx 3.8.1. My brief code as below:

CircuitBreakerOptions circuitBreakerOptions = new CircuitBreakerOptions()
            .setMaxFailures(5)
            .setTimeout(100) 
            .setFallbackOnFailure(true) 
            .setResetTimeout(10_000); 
  circuit = CircuitBreaker
        .create("handler-circuit-breaker", vertx, circuitBreakerOptions);
circuit.fallback(v -> {
      // Executed when the circuit is opened
      LOG.info("fallback not work for timeout");  //code not fall this place.
      return "";
    });

    circuit.execute(promise -> {
      try {
        Thread.sleep(1000); //stay here long time more than config in option just 100ms
      } catch (InterruptedException e) {
      }
        promise.complete("OK");
    });

Thanks,
Huy Bui.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant