The main difference I see with the change from a DurableMailbox to using a 
PersistentChannel/AtLeastOnceDelivery is the former seems "pull" based 
while the latter is "push". Is this the case? I'm curious if there's a way 
I can essentially implement a durable mailbox based on the Persistence 
framework?  Basically I want to pile a bunch of messages into this mailbox 
and have the actor process them when it "can" with a producer timeout 
restriction. I know this is related to the Reactive Stream stuff, but I'm 
interested in something near term and deciding if I should implement a 
DurableMailbox or spend more time trying to bend Persistence to work with 
my stateless actor.

Thanks
-Jeff

On Monday, March 24, 2014 8:53:23 AM UTC-6, Patrik Nordwall wrote:
>
> The big difference is that when using akka-persistence the messages are 
> not stored immediately when placed in the mailbox. When you receive the 
> Persistent message in the Processor you know that it has been stored. The 
> sender can let go of the responsibility when it has received an explicit 
> acknowledgement message from the Processor.
>
> A safe hand-off like that can also be implemented with a 
> PersistentChannel. This is rather close to a durable mailbox, but so much 
> better.
>
> class Endpoint extends Actor {
>   val channel = context.actorOf(PersistentChannel.props(
>     PersistentChannelSettings(redeliverInterval = 3.seconds, redeliverMax 
> = 10,
>       replyPersistent = true)), name = "myChannel")
>   val destination = context.system / "jobManager"
>
>   import context.dispatcher
>   implicit val timeout = Timeout(5.seconds)
>  
>
>   def receive = {
>     case job: Job =>
>       (channel ? Deliver(Persistent(job), destination)) map {
>         case _: Persistent => "OK: " + job.id
>       } recover {
>         case e => "FAILED: " + job.id
>       } pipeTo sender()
>   }
> }
>
> Cheers,
> Patrik
>
>
>
> On Mon, Mar 24, 2014 at 3:22 PM, Akka Team <akka.o...@gmail.com 
> <javascript:>> wrote:
>
>> Hi Logan,
>>
>>
>>  I took a look into the akka-persistence documentation and from what I 
>>> can gather the goal of the project is to store processed messages so that 
>>> an actor's state can be rebuilt upon an actor's restart, while I'd like to 
>>> store unprocessed messages so they can be processed upon an actor's restart 
>>> (for my purposes, my actor is essentially stateless).
>>>
>>
>> Processors (
>> http://doc.akka.io/docs/akka/2.3.0/scala/persistence.html#Processors) 
>> store the message *first* and then process them. If you do not want to keep 
>> the whole history of the Processor in the journal you can delete messages: 
>> http://doc.akka.io/docs/akka/2.3.0/scala/persistence.html#Message_deletion
>>
>> -Endre
>>  
>>
>>>
>>> Am I understanding this incorrectly? Is there a way to accomplish my 
>>> goal with the persistence module, or is there an alternative approach?
>>>
>>> Thanks!
>>>
>>> -- 
>>> >>>>>>>>>> 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 <javascript:>.
>>> To post to this group, send email to akka...@googlegroups.com 
>>> <javascript:>.
>>> Visit this group at http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Akka Team
>> Typesafe - The software stack for applications that scale
>> Blog: letitcrash.com
>> Twitter: @akkateam
>>  
>> -- 
>> >>>>>>>>>> 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 <javascript:>.
>> To post to this group, send email to akka...@googlegroups.com 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Patrik Nordwall
> Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
> Twitter: @patriknw
>
>  

-- 
>>>>>>>>>>      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+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to