Question about how to use PeekMailBox

15 views
Skip to first unread message

Yan Pei

unread,
Jul 25, 2016, 2:52:25 PM7/25/16
to Akka User List
Hello All,

  I am trying to use PeekMailBox for retrying after the message processing failed.
  In the Actor, I am using Future to delivery the message for processing and piping the result back to itself. Do some matching(Failure or something else) after that.
  Where am I supposed to put PeekMailboxExtension.lookup().ack(context)? I couldn't put inside the future or before after future or matching section.

Thanks for helping!
Yan

Akka Team

unread,
Jul 27, 2016, 10:24:51 AM7/27/16
to Akka User List
Hi Yan,

I'd recommend you to try to start out with some messaging pattern instead of reaching for special mailboxes.

Did you try just catching the exception and retrying your logic rather than relying on supervision for this?
A second option would be to have the sender retry sending the message after a timeout. A third option would
be to provide a parent actor that outside actors interact with who contains the retry logic (which messages are in
flight and what child is processing what message, how many retries for a specific message) and lets the children
just fail without caring about the retry logic.

--
Johan

--
>>>>>>>>>> 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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Yan Pei

unread,
Aug 3, 2016, 1:13:39 PM8/3/16
to Akka User List
Hi Johan,

   Thank you very much for your suggestions. The supervisor strategy has options of stop/resume/escalate/restart, I didn't figure out how to resend the failed message via supervisor strategy.  The sender is in sending and forgot mode and no confirmation for sender since it's batch process, so the send option will not apply.  I will try the third option.

Thanks again,
Yan
Reply all
Reply to author
Forward
0 new messages