-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception creating actor implementing IWithUnboundedStash #941
Comments
As the exception complains about the mailbox type, have you configured the actor to use some custom mailbox type? Not all mailboxes support stashing, as the mailbox has to be able to prepend messages at the front when using stashing. |
I haven't changed the configuration of the mailbox type. It's just a vanilla ReceiveActor with no custom configuration. This sample actor has the same issue with resolving through DI
When resolving it through
it errors, when creating it directly through
it's fine The registration in autofac is just:
Cheers |
The problem is in the
It returns the type of the dependencyResolver instead of the ActorType. This causes the rest of the Actor Initialisation routine to fail to detect the IWithUnboundedStash and inject the wrong Mailbox type. |
@Danthar Thanks for catching that one. |
Still can't use IWithUnboundedStash actor from DI Context. Akka.Actor.Internal.AbstractStash is trying to get: If actor is created from system directly, the actorCell.Mailbox is Akka.Dispatch.UnboundedDequeBasedMailbox, that is IDequeBasedMailbox. If actor is created from DI (AutoFac), the actorCell.Mailbox is Next it checks if the mailbox is not null, and throw the "DequeBasedMailbox required" exception. |
A PR containing a fix got merged a short while ago. Have you tried it with a version including that fix? I believe nowadays we have nightlies on nuget but I'm not sure @Aaronontheweb (?) -----Original Message----- Still can't use IWithUnboundedStash actor from DI Context. |
I found it. Its a stupid typo in my last PR. Ill fix that asap. |
A fix for this issue has been merged several days ago. Ergo this can be closed. |
From @mithril52 , Akka version 1.0.5 and Ninject DI:
|
@Horusiath same error different DI package? |
Sorry, my bad. Using container directly to creat an actor will always fail. Closing this. |
Is it the same issue or I just doing something wrong? |
When an actor that implements IWithUnboundedStash that was resolved from DIExt (autofac in this case, although I doubt that matters) calls it's first Become, this exception is thrown:
The text was updated successfully, but these errors were encountered: