There is a offset: Long that the query journal can implement in a way that is suitable. Easiest is to use a timestamp, or a global sequence number if you have that luxury (e.g. a sql database).
The Cassandra plugin is using a timeuuid (a Cassandra data type) column and therefore supports queries with timestamp offset <https://github.com/akka/akka-persistence-cassandra/blob/master/src/main/scala/akka/persistence/cassandra/query/scaladsl/CassandraReadJournal.scala#L216> or uuid offset <https://github.com/akka/akka-persistence-cassandra/blob/master/src/main/scala/akka/persistence/cassandra/query/scaladsl/CassandraReadJournal.scala#L237> . Cheers, Patrik On Fri, Feb 12, 2016 at 8:56 AM, Andrew Easter <[email protected]> wrote: > Hi everyone. Just waking up this thread with a related challenge/question. > > One of the objectives of Persistence Query was to address the limitation > that a PersistentView was only able to project from a single persistence > id. As we all know, this meant that trying to do CQRS in a DDD based system > (actor per instance of an aggregate) wasn't possible without workarounds. > The workaround I used was to have all my aggregate actors send (using ALOD > trait) events on to an intermediate persistent actor, one per aggregate > type. This meant I could create a PersistentView that could see a stream of > all events from all instances of an aggregate type. > > Obviously, the above solution is a little cumbersome. Downsides such as > having to essentially duplicate all events in the intermediate persistent > actor. > > The Persistence Query introduces us to the concept of querying events by > tag - the docs suggest this as the most appropriate method for implementing > CQRS in a DDD based actor implementation. However, I'm struggling to > understand how this is really fit for purpose given that there are no order > guarantees in an eventsByTag stream, and accordingly no sequence number I > can refer back to such that I know how far through the stream I've read. > > The discussion here is about persisting an offset in the view datastore, > but how can I do that when there is no reliable seq number? > > Sorry if I'm not making sense! Would love to hear some ideas about how to > deal with this. > > Thanks, Andrew > > -- > >>>>>>>>>> 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. > -- 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 [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.
