epam / Wilma

Service Virtualization Solution – a combined Service Stub and Transparent Proxy
GNU General Public License v3.0
58 stars 12 forks source link

Example: Circuit Breaker #60

Closed tkohegyi closed 7 years ago

tkohegyi commented 9 years ago

Need example solution for creating CircuitBreaker with Wilma.

Purpose: When we use Wilma in microservice environment, we might want to use it to act as circuit-breaker too. However it is possible, it is not offered by Wilma by default. Offering a default solution of circuit-breaker would be nice.

The Approach and Description below is just an initial idea, might be changed during the actual implementation

Approach: monitor req-res pairs, and if there is a problem, or it is requested, forward requests to its stub for a certain time.

Description: Need interceptor that gets both request and response. Req interceptor: adds special header with circuit-breaker-ID Resp interceptor: evaluates if response is ok/not ok, and if not ok, turns on the circuit breaker Class name: CircuitBreaker Parameter list in XML:

Need API extension with:

What circuitbreaker ON would mean: enable all dialogdescriptors where the name contains the circuitBreakerID at the end of its name, with timeout.

tkohegyi commented 7 years ago

Branch "cb" is used to implement this.

tkohegyi commented 7 years ago

Done - see implemented solution and readme here: https://github.com/epam/Wilma/tree/master/wilma-extras/circuit.breaker