Circuit breaker design pattern implementation

后端 未结 6 1770
不思量自难忘°
不思量自难忘° 2020-12-24 08:37

I have tried unsuccessfully to implement circuit breaker pattern, here, in Java using Spring framework.

How can you implement circuit breaker pattern by Java and Sp

6条回答
  •  自闭症患者
    2020-12-24 09:06

    You can have a look at JCircuitBreaker . The implementation there implements circuit breaker like approach.

    Please note that this is not 1:1 implementation of the pattern because it does not define fixed states like "half-open". Instead it makes the decision (if the breaker should be open or closed) basing on current application state (using so called "break strategy"). Nevertheless it should be possible to define such a "break strategy" which evaluates failures thresholds - so it should be possible to also implement original pattern using JCircuitBreaker.

提交回复
热议问题