Skip to content

Example: Circuit Breaker #60

@tkohegyi

Description

@tkohegyi

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:

  • circuitBreakerID - unique name/id of the circuit breaker, will be added by req interceptor
  • ServicePattern - pattern of target service url in order to identify the target service this circuitbreaker belongs to
  • timeout - defines how long the circuit break should be active after turned on, in msec
  • errorcodes - lit of Exxx codes when response should be considered as bad, and circuit breaker should be turned on - if empty nothing to do (response evaluation will be done externally)

Need API extension with:

  • CircuitBreakerDescriptor[] getCircuitBreakerDescriptorList() - get all circuit breakers
  • long (?) getCircuitBreakerStatus(CircuitBreakerDescriptor cb) - gets the remaining time (in msec) meanwhile the cbis turned on, or 0 if cbis off
  • setCircuitBreakerStatus(CircuitBreakerDescriptor cb, long(?) timeout) - turns on cb, with timeout, or turns cb off if timout is 0 or less - this can be used when cb should be turned on/off from external party

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions