Querying Snapshot messages using Akka Persistence Query

429 views
Skip to first unread message

aga...@sointeractive.pl

unread,
Mar 11, 2016, 3:48:31 AM3/11/16
to Akka User List
Hello! 
I was looking for and not found anywhere any information about ability to get snapshots from snapshot store using Akka Persistence Query. Do you know any way of doing such a thing?

Konrad Malawski

unread,
Mar 11, 2016, 4:03:41 AM3/11/16
to akka...@googlegroups.com, aga...@sointeractive.pl
But which datastores?

The event journals are often different entities than the SnapshotStore.
If it's the same, it's technically doable, however then it's implementation dependent – there is no general answer about this :)

-- 
Cheers,
Konrad 'ktoso’ Malawski
Akka @ Lightbend

On 11 March 2016 at 09:48:27, aga...@sointeractive.pl (aga...@sointeractive.pl) wrote:

Hello! 
I was looking for and not found anywhere any information about ability to get snapshots from snapshot store using Akka Persistence Query. Do you know any way of doing such a thing?
--
>>>>>>>>>> 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.

aga...@sointeractive.pl

unread,
Mar 11, 2016, 4:24:28 AM3/11/16
to Akka User List, aga...@sointeractive.pl
Sorry, I've forgotten to mention. We are using Cassandra plugin. 

Patrik Nordwall

unread,
Mar 11, 2016, 4:42:09 AM3/11/16
to akka...@googlegroups.com, aga...@sointeractive.pl
On Fri, Mar 11, 2016 at 10:24 AM, <aga...@sointeractive.pl> wrote:
Sorry, I've forgotten to mention. We are using Cassandra plugin. 

That feature is not supported by the Cassandra plugin.
Snapshots should only be seen as an optimization for the recovery process of persistent actors.

/Patrik



--

Patrik Nordwall
Akka Tech Lead
Lightbend -  Reactive apps on the JVM
Twitter: @patriknw

 Lightbend

aga...@sointeractive.pl

unread,
Mar 11, 2016, 4:59:20 AM3/11/16
to Akka User List, aga...@sointeractive.pl
But why perform building views(read model), using Persistence Query, by processing all events from the bottom of journal when there is a possibility of significant reduction of this process both in time and resources? 

Patrik Nordwall

unread,
Mar 11, 2016, 10:35:05 AM3/11/16
to akka...@googlegroups.com
Normally you don't rebuild the views (read model).

If you really need that you can start a PersistentActor with same persistenceId, but make sure that you dont write anything from it.

Sasha S

unread,
Apr 27, 2017, 11:06:44 AM4/27/17
to Akka User List, aga...@sointeractive.pl
пятница, 11 марта 2016 г., 10:48:31 UTC+2 пользователь aga...@sointeractive.pl написал:
Hello! 
I was looking for and not found anywhere any information about ability to get snapshots from snapshot store using Akka Persistence Query. Do you know any way of doing such a thing?

 Whenever I assume correct, you try to implement CQRS pattern, etc. one Writer part manages some state using Event Sourcing while multiple Readers keep the same state for querying.
If it so , you can find the code here http://stackoverflow.com/questions/38246786/akka-persistence-query-event-stream-and-cqrs/43635674#43635674 (last answer). I combined Persistent Query & Persistent Actor together to Implement the Reader.

If it not so, the formal answer is no, you can't recover from Snapshots using only  Persistence Query.
Reply all
Reply to author
Forward
0 new messages