feat: register ManagementActor on Central with ClusterClientReceptionist

This commit is contained in:
Joseph Doherty
2026-03-17 14:49:35 -04:00
parent 1dc7d50bce
commit 1942544769
4 changed files with 15218 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
using Akka.Actor;
using Akka.Cluster;
using Akka.Cluster.Tools.Client;
using Akka.Cluster.Tools.Singleton;
using Akka.Configuration;
using Microsoft.Extensions.Options;
@@ -175,6 +176,15 @@ akka {{
var commService = _serviceProvider.GetService<CommunicationService>();
commService?.SetCommunicationActor(centralCommActor);
// Management Service — accessible via ClusterClient
var mgmtLogger = _serviceProvider.GetRequiredService<ILoggerFactory>()
.CreateLogger<ScadaLink.ManagementService.ManagementActor>();
var mgmtActor = _actorSystem!.ActorOf(
Props.Create(() => new ScadaLink.ManagementService.ManagementActor(_serviceProvider, mgmtLogger)),
"management");
ClusterClientReceptionist.Get(_actorSystem).RegisterService(mgmtActor);
_logger.LogInformation("ManagementActor registered with ClusterClientReceptionist");
_logger.LogInformation("Central actors registered. CentralCommunicationActor created.");
}