简体   繁体   中英

How to completely stop the circuit breaker in Vertx

I am working on an application that is using the Vertx. In it, I have a NetClient and uses the Vertx Circuit Breaker for a continuously stay connected to a server. I now am working on something that requires these Verticles to be undeployed at some point but when I do, it seems like the circuit breaker for some reason stays alive even after verticle.undeploy has succeeded.

I've tried calling the close method for the Circuit Breaker before undeploying, but even with that, I get a very inconsistent result. First time it works but second time around, the circuit breaker stays alive.

Any idea if it's possible to completely kill the circuit breaker once started?

Using: Java 8 and Vertx 3.8.1

If anyone has a good and consistent solution to this, I'd be happy to change the selected answer to it but since I don't see any responses, I will share what I ended up doing with this.

I basically gave up trying to kill the circuit breaker. Instead, I added logic in between to consider an additional state. With this variable, I either executed the desired code or sent the circuit breaker in a infinite waiting-loop until an external request is received to break out of that loop and go back to the circuit breaker loop.

Maybe this is the more logical approach, I'm honestly not sure but I was able to achieve what I needed with this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM