Generic Actor not starting after Akka.Dependency injection upgrade #6118
-
Hi all, I am upgrading a project from Akka.DI.Core and Akka.DI.CastleWindsor to Akka.DependencyInjection and Castle.Windsor.Extensions.DependencyInjection. The reason to add Castle.Windsor.Extensions.DependencyInjection was to reuse the preexisting Windsor registration code based on IWindsorContainer interface. So far so good, I was able reuse the IWindsorContainer registrations and could boot all actors except one, a generic actor called AzureQueueReader<T, TTrigger>. Looks like the dependency tree is not being correctly built ... anyway I've set a public repo that shows the exact error. The main application project is the console app PocAkkaCastleWindsor, if someone could take a look it would be of great help. Thank you very much |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
On these lines: https://github.com/marcoshass/PocAkkaCastleWindsor/blob/master/src/PocAkkaCastleWindsor.Actors/Installers/ActorInstaller.cs#L38-L42 You can't use a dependency injection to create an instance of an actor, Akka.NET have its own ways to instantiate new actors. |
Beta Was this translation helpful? Give feedback.
On these lines: https://github.com/marcoshass/PocAkkaCastleWindsor/blob/master/src/PocAkkaCastleWindsor.Actors/Installers/ActorInstaller.cs#L38-L42
You can't use a dependency injection to create an instance of an actor, Akka.NET have its own ways to instantiate new actors.
What you can do instead is to register an
IAzureQueueReaderConfigurator<CompletedOrderMessage>
service that will be injected into the new actor.