Table of Contents

Class GatewayResiliencePipeline

Namespace
Virtufin.Api.HealthChecks
Assembly
Virtufin.Api.dll

Retry + circuit breaker for the gateway's direct gRPC calls to backend services — i.e. Gateway.Invoke and Gateway.InvokeJson, which route through GrpcChannelPool and never touch a Dapr sidecar.

This was previously called DaprResiliencePipeline, with DAPR_* environment variables, which was actively misleading: it has never wrapped a Dapr SDK call. Both call sites wrap ExecuteCallAsync on the reflection service. An architecture review initially read the pair as duplicating Dapr's own resiliency building block; they are in fact disjoint.

Resilience for the sidecar's calls out to Dapr components (statestore, pubsub) is declared separately, as a Dapr Resiliency resource in helm/templates/resiliency.yaml. Keep the two sets of numbers in step so both paths degrade the same way.

Constants are configurable via GatewayResilienceOptions (env-var-driven).

public sealed class GatewayResiliencePipeline
Inheritance
GatewayResiliencePipeline
Inherited Members

Constructors

GatewayResiliencePipeline(ILogger<GatewayResiliencePipeline>, GatewayResilienceOptions)

public GatewayResiliencePipeline(ILogger<GatewayResiliencePipeline> logger, GatewayResilienceOptions options)

Parameters

logger ILogger<GatewayResiliencePipeline>
options GatewayResilienceOptions

Properties

CircuitBroken

public bool CircuitBroken { get; }

Property Value

bool

Methods

ExecuteAsync(Func<CancellationToken, Task<GrpcCallResult>>, CancellationToken)

Runs a proxied gateway call through retry + circuit breaker. Typed over GrpcCallResult because failures arrive as returned values, not thrown exceptions — see the pipeline construction above.

public Task<GrpcCallResult> ExecuteAsync(Func<CancellationToken, Task<GrpcCallResult>> action, CancellationToken cancellationToken)

Parameters

action Func<CancellationToken, Task<GrpcCallResult>>
cancellationToken CancellationToken

Returns

Task<GrpcCallResult>