Skip to content
bitzorcas
EN

Concept

HTTP resilience

Planned HTTP resilience — Polly-based retry, circuit-breaker, and timeout policies for outbound HTTP calls.

Last updated

BitzOrcas does not yet include HTTP resilience policies (Polly-based retry, circuit-breaker, or timeout) for outbound HTTP calls. The webhook delivery system has its own retry logic, but there’s no shared resilience pipeline.

Current state

Outbound HTTP calls use HttpClient directly without resilience policies:

// Webhook delivery has its own retry logic
public class DefaultWebhookHttpClient : IWebhookHttpClient
{
// Uses HttpClient directly with custom retry in WebhookDeliveryService
}

External request logging

ExternalRequestLoggingHandler provides audit logging for outbound HTTP calls:

// Registered for HTTP client requests — logs method, URL, status, duration

Planned implementation

PolicyDescription
RetryExponential backoff for transient failures (5xx, timeout)
Circuit BreakerOpen circuit after N consecutive failures
TimeoutPer-request timeout with cancellation
Rate LimiterPer-downstream rate limiting

Target configuration

{
"HttpResilience": {
"Default": {
"MaxRetries": 3,
"BackoffBase": "00:00:02",
"CircuitBreakerFailureThreshold": 5,
"Timeout": "00:00:30"
}
}
}

Webhook retry (existing)

The webhook delivery system has its own WebhookRetryPolicy:

public class WebhookRetryPolicy
{
public int MaxRetries { get; } = 5;
public TimeSpan InitialDelay { get; } = TimeSpan.FromSeconds(5);
public double BackoffMultiplier { get; } = 2.0;
}

This serves as a reference pattern for the broader resilience implementation.

See also