How to save the PersistentActor MailBox messages?, So that I can process when system is restarted after JVM crash

427 views
Skip to first unread message

Aditya Devisetty

unread,
Mar 23, 2015, 11:03:55 PM3/23/15
to akka...@googlegroups.com
Hi,

Using Persistent we can save the sate of an actor , but how to save the mailbox messages of a persistent actor.

 I heard about Durable Mailbox. But this durable mailbox   of type akka.actor.mailbox.filebased.FileBasedMailboxType is not working with persistent actor. It is throwing below exception : 

Exception in thread "main" akka.ConfigurationException: configuration problem while creating [akka://example/user/persistentActor-4-java] with dispatcher [my-dispatcher] and mailbox [akka.actor.default-mailbox]
    at akka.actor.LocalActorRefProvider.actorOf(ActorRefProvider.scala:722)
    at akka.actor.dungeon.Children$class.makeChild(Children.scala:206)
    at akka.actor.dungeon.Children$class.attachChild(Children.scala:41)
    at akka.actor.ActorCell.attachChild(ActorCell.scala:369)
    at akka.actor.ActorSystemImpl.actorOf(ActorSystem.scala:553)
    at sample.persistence.PersistentActorExample.main(PersistentActorExample.java:209)
Caused by: java.lang.IllegalArgumentException: produced message queue type [interface akka.dispatch.MessageQueue] does not fulfill requirement for actor class [class sample.persistence.ExamplePersistentActor]
    at akka.dispatch.Mailboxes.verifyRequirements$1(Mailboxes.scala:148)
    at akka.dispatch.Mailboxes.getMailboxType(Mailboxes.scala:156)
    at akka.actor.LocalActorRefProvider.actorOf(ActorRefProvider.scala:717)

Konrad Malawski

unread,
Mar 24, 2015, 5:52:10 AM3/24/15
to Akka User List
Don't use FileBasedMailboxType, it's deprecated and not something we recommend doing (semantics wise).
Use Persistent Actors, they are documented here: http://doc.akka.io/docs/akka/current/scala/persistence.html

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--

Roland Kuhn

unread,
Mar 24, 2015, 5:57:24 AM3/24/15
to akka-user
Hi Aditya,

we removed durable mailboxes because the concept is flawed. The replacement in akka-persistence is the AtLeastOnceDelivery trait: instead of hoping that mailbox messages are replayed later (which cannot be a hard guarantee anyway) we make the sender responsible for resending the message until processed, even across system crashes.

Regards,

Roland

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



Dr. Roland Kuhn
Akka Tech Lead
Typesafe – Reactive apps on the JVM.
twitter: @rolandkuhn


Reply all
Reply to author
Forward
0 new messages