feat: HistorianGateway as the OtOpcUa historian backend (read/write/alarms + continuous historization); retire Wonderware #423

Merged
dohertj2 merged 40 commits from feat/historian-gateway-backend into master 2026-06-27 11:09:04 -04:00
2 changed files with 8 additions and 2 deletions
Showing only changes of commit 245db98f5e - Show all commits
@@ -25,7 +25,7 @@ namespace ZB.MOM.WW.OtOpcUa.Driver.Historian.Gateway.Recorder;
/// durably queued must not be re-drained. /// durably queued must not be re-drained.
/// </para> /// </para>
/// </remarks> /// </remarks>
public sealed class GatewayHistorianValueWriter : IHistorianValueWriter public sealed class GatewayHistorianValueWriter : IHistorianValueWriter, IAsyncDisposable
{ {
private readonly IHistorianGatewayClient _client; private readonly IHistorianGatewayClient _client;
private readonly ILogger<GatewayHistorianValueWriter> _logger; private readonly ILogger<GatewayHistorianValueWriter> _logger;
@@ -86,4 +86,10 @@ public sealed class GatewayHistorianValueWriter : IHistorianValueWriter
return false; return false;
} }
} }
/// <summary>
/// Disposes the underlying gateway client (and its gRPC channel). The DI container owns this
/// writer as a singleton, so this fires once at host shutdown — closing the channel gracefully.
/// </summary>
public ValueTask DisposeAsync() => _client.DisposeAsync();
} }
@@ -75,7 +75,7 @@ public sealed class ContinuousHistorizationOptions
var warnings = new List<string>(); var warnings = new List<string>();
if (!Enabled) return warnings; if (!Enabled) return warnings;
if (string.IsNullOrWhiteSpace(OutboxPath)) if (string.IsNullOrWhiteSpace(OutboxPath))
warnings.Add("ContinuousHistorization:OutboxPath is empty while historization is enabled — the durable outbox has no directory to persist to; the recorder cannot be wired."); warnings.Add("ContinuousHistorization:OutboxPath is empty while historization is enabled — the durable outbox has no directory to persist to; host startup will fail when the outbox is constructed. Set an absolute path on durable storage.");
if (string.Equals(CommitMode, "Periodic", StringComparison.OrdinalIgnoreCase) && CommitIntervalMs <= 0) if (string.Equals(CommitMode, "Periodic", StringComparison.OrdinalIgnoreCase) && CommitIntervalMs <= 0)
warnings.Add($"ContinuousHistorization:CommitIntervalMs is {CommitIntervalMs} — must be > 0 in Periodic commit mode; the periodic-commit loop cannot run."); warnings.Add($"ContinuousHistorization:CommitIntervalMs is {CommitIntervalMs} — must be > 0 in Periodic commit mode; the periodic-commit loop cannot run.");
return warnings; return warnings;