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:
@@ -422,7 +422,7 @@ public class DeploymentManagerActor : ReceiveActor, IWithTimers
|
||||
if (_createdConnections.Contains(name))
|
||||
continue;
|
||||
|
||||
var connectionDetails = new Dictionary<string, string>();
|
||||
var primaryDetails = new Dictionary<string, string>();
|
||||
if (!string.IsNullOrEmpty(connConfig.ConfigurationJson))
|
||||
{
|
||||
try
|
||||
@@ -431,14 +431,29 @@ public class DeploymentManagerActor : ReceiveActor, IWithTimers
|
||||
using var doc = System.Text.Json.JsonDocument.Parse(connConfig.ConfigurationJson);
|
||||
foreach (var prop in doc.RootElement.EnumerateObject())
|
||||
{
|
||||
connectionDetails[prop.Name] = prop.Value.ToString();
|
||||
primaryDetails[prop.Name] = prop.Value.ToString();
|
||||
}
|
||||
}
|
||||
catch { /* Ignore parse errors */ }
|
||||
}
|
||||
|
||||
Dictionary<string, string>? backupDetails = null;
|
||||
if (!string.IsNullOrEmpty(connConfig.BackupConfigurationJson))
|
||||
{
|
||||
try
|
||||
{
|
||||
backupDetails = new Dictionary<string, string>();
|
||||
using var doc = System.Text.Json.JsonDocument.Parse(connConfig.BackupConfigurationJson);
|
||||
foreach (var prop in doc.RootElement.EnumerateObject())
|
||||
{
|
||||
backupDetails[prop.Name] = prop.Value.ToString();
|
||||
}
|
||||
}
|
||||
catch { backupDetails = null; /* Ignore parse errors */ }
|
||||
}
|
||||
|
||||
_dclManager.Tell(new Commons.Messages.DataConnection.CreateConnectionCommand(
|
||||
name, connConfig.Protocol, connectionDetails));
|
||||
name, connConfig.Protocol, primaryDetails, backupDetails, connConfig.FailoverRetryCount));
|
||||
|
||||
_createdConnections.Add(name);
|
||||
_logger.LogInformation(
|
||||
|
||||
Reference in New Issue
Block a user