TsgcWSCircuitBreakerProperties › Enabled

Enabled Property

Master switch that turns the whole circuit breaker on or off.

Syntax

property Enabled: Boolean read FEnabled write FEnabled default True;

Default Value

Remarks

When Enabled is False, every public method short-circuits to "allowed", no state transitions are evaluated and no counters are updated — IsCallAllowed, IsConnectionAllowed and IsMessageAllowed return True, Execute / ExecuteWithResult run the action unconditionally, and RecordSuccess / RecordFailure become no-ops. Use this flag to temporarily disable the breaker at runtime (during a controlled load test, during a maintenance window, or to bypass a bad configuration) without unassigning the component from the HTTP API client's CircuitBreaker property. The setting applies globally — to disable just one host, leave Enabled=True and use PerEndpoint with extreme thresholds instead.

Example

// Temporarily disable the breaker during a load test
sgcWSCircuitBreaker1.Enabled := False;
try
  RunLoadTest;
finally
  sgcWSCircuitBreaker1.Enabled := True;
end;

Back to Properties