private void Ready() { _log.Debug("AggregateRootCoordinatorActor entering Ready state"); Receive<IAccountMessage>(msg => { //this is a pool of operators and we want to forward our message on to a PropertyOperator if (!_accountWorkerRefs.ContainsKey(msg.AccountId)) { //_accountWorkerRefs.Add(msg.AccountId,Context.ActorOf(Context.DI().Props<AccountActor>())); AggregateRootCreationParameters parms = new AggregateRootCreationParameters(msg.AccountId,ActorRefs.Nobody,4); var props = Props.Create<AccountActor>(parms); _accountWorkerRefs.Add(msg.AccountId,Context.ActorOf(props, "aggregates(account)"+msg.AccountId.ToString())); } _accountWorkerRefs[msg.AccountId].Forward(msg); }); }
private TestActorRef<AccountActor> PrepareTest(Guid id,TestProbe probe,string name) { var relayProps = Props.Create<ProbeRelay>(probe); var testSink = Sys.ActorOf(relayProps, "testrelay" + name); _parms = new AggregateRootCreationParameters(id,testSink, 4); return ActorOfAsTestActorRef(() => new AccountActor(_parms), "test" + name); }