Hi,

Here's the way I think about it - the PersistenceQuery provides the part of 
your system that reads and processes events. This part of the system only 
uses PersistenceQuery, and doesn't need any PersistentActors.

The other part of the system is the one that persists the events. This can 
either be done by accessing the journal APIs to persist events "manually", 
or by using a PersistentActor. Using a PersistentActor makes persisting the 
events easier, but it also comes with some "baggage" - A PersistentActor is 
assumed to be a stateful entity, so if the actor crashes it needs to 
recover its old state. That is done via receiveRecover. However, in the 
simple use case, where the PersistentActor just persists the events without 
maintaining any internal state, the receiveRecover is not needed and can be 
left empty.

Tal



On Thursday, December 31, 2015 at 4:33:15 PM UTC+2, Jan-Terje Sørensen 
wrote:
>
> Hi,
>
> Both PersistenceQuery.ReadJournal and PersistentActor.onReceiveRecover 
> handles events. 
>
> As I understand it we shall always use PersisteceQuery when projecting our 
> data. Can anyone please explain when I need to use the 
> PersistentActor.receiveRecover?
>

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

Reply via email to