feat(dcl): extend CreateConnectionCommand with backup config and failover retry count
Update CreateConnectionCommand to carry PrimaryConnectionDetails, BackupConnectionDetails, and FailoverRetryCount. Update all callers: DataConnectionManagerActor, DataConnectionActor, DeploymentManagerActor, FlatteningService, and ConnectionConfig. The actor stores both configs but continues using primary only — failover logic comes in Task 3.
This commit is contained in:
@@ -61,6 +61,9 @@ public class DataConnectionActor : UntypedActor, IWithStash, IWithTimers
|
||||
private int _resolvedTags;
|
||||
|
||||
private readonly IDictionary<string, string> _connectionDetails;
|
||||
private readonly IDictionary<string, string> _primaryConfig;
|
||||
private readonly IDictionary<string, string>? _backupConfig;
|
||||
private readonly int _failoverRetryCount;
|
||||
|
||||
/// <summary>
|
||||
/// Captured Self reference for use from non-actor threads (event handlers, callbacks).
|
||||
@@ -73,13 +76,18 @@ public class DataConnectionActor : UntypedActor, IWithStash, IWithTimers
|
||||
IDataConnection adapter,
|
||||
DataConnectionOptions options,
|
||||
ISiteHealthCollector healthCollector,
|
||||
IDictionary<string, string>? connectionDetails = null)
|
||||
IDictionary<string, string>? primaryConfig = null,
|
||||
IDictionary<string, string>? backupConfig = null,
|
||||
int failoverRetryCount = 3)
|
||||
{
|
||||
_connectionName = connectionName;
|
||||
_adapter = adapter;
|
||||
_options = options;
|
||||
_healthCollector = healthCollector;
|
||||
_connectionDetails = connectionDetails ?? new Dictionary<string, string>();
|
||||
_primaryConfig = primaryConfig ?? new Dictionary<string, string>();
|
||||
_backupConfig = backupConfig;
|
||||
_failoverRetryCount = failoverRetryCount;
|
||||
_connectionDetails = _primaryConfig;
|
||||
}
|
||||
|
||||
protected override void PreStart()
|
||||
|
||||
@@ -45,10 +45,13 @@ public class DataConnectionManagerActor : ReceiveActor
|
||||
}
|
||||
|
||||
// WP-34: Factory creates the correct adapter based on protocol type
|
||||
var adapter = _factory.Create(command.ProtocolType, command.ConnectionDetails);
|
||||
var adapter = _factory.Create(command.ProtocolType, command.PrimaryConnectionDetails);
|
||||
|
||||
var props = Props.Create(() => new DataConnectionActor(
|
||||
command.ConnectionName, adapter, _options, _healthCollector, command.ConnectionDetails));
|
||||
command.ConnectionName, adapter, _options, _healthCollector,
|
||||
command.PrimaryConnectionDetails,
|
||||
command.BackupConnectionDetails,
|
||||
command.FailoverRetryCount));
|
||||
|
||||
// Sanitize name for Akka actor path (replace spaces and invalid chars)
|
||||
var actorName = new string(command.ConnectionName
|
||||
|
||||
Reference in New Issue
Block a user