0
我試圖在多於一個的akka actor系統上拆分負載。 不幸的是,循環組不會將消息轉發給遠程工作人員。我可以看到演員已啓動,但沒有完成任何工作。在兩個不同的主機上的循環組不能正常工作
完整的代碼是github
有沒有辦法,我可以在我的配置錯過任何其他設置?
private void CreateRemoteCrawlerGroup()
{
var hostname = "374110044f24";
var hostname2 = "25b360699a27";
var remoteAddress2 = Address.Parse($"akka.tcp://[email protected]{hostname2}:8090");
var remoteScope2 = new RemoteScope(remoteAddress2);
var remoteCrawler1 =
Context.ActorOf(
Props.Create(() => new WebCrawlerActor(new AppSettingsConfiguration(), Self))
.WithRouter(new RoundRobinPool(2)) // new DefaultResizer(1, 2, messagesPerResize: 500)
.WithDispatcher("my-dispatcher")
.WithDeploy(Deploy.None.WithScope(remoteScope2)), "a");
var remoteAddress = Address.Parse($"akka.tcp://[email protected]{hostname}:8090");
var remoteScope = new RemoteScope(remoteAddress);
var remoteCrawler2 =
Context.ActorOf(
Props.Create(() => new WebCrawlerActor(new AppSettingsConfiguration(), Self))
.WithRouter(new RoundRobinPool(2)) // new DefaultResizer(1, 2, messagesPerResize: 500)
.WithDispatcher("my-dispatcher")
.WithDeploy(Deploy.None.WithScope(remoteScope)), "remoteCrawler01");
var workers = new List<string> { remoteCrawler1.Path.ToString(), remoteCrawler2.Path.ToString() };
var router = Context.ActorOf(Props.Empty.WithRouter(new RoundRobinGroup(workers)), "some-group");
_actorDictionary.Add("WebCrawlerActor", router);
}