I'm using Akka Persistence, with LevelDB as storage plugin, in an application written in Scala. On the query-side, the current implementation uses PersistentView
, which polls messages from a PersistentActor
's journal by just knowing the identifier of the actor.
Now I've learned that PersistentView
is deprecated, and one is encouraged to use Persistent Query instead. However, I haven't found any thorough description on how to adapt the code from using PersistentView
to support the preferred Persistence Query implementation.
Any help would be appreciated!
From the 2.4.x-to-2.5.x migration guide:
Removal of PersistentView
After being deprecated for a long time, and replaced by Persistence Query
PersistentView
has now been removed.The corresponding query type is
EventsByPersistenceId
. There are several alternatives for connecting the Source to an actor corresponding to a previousPersistentView
actor which are documented in Integration.The consuming actor may be a plain
Actor
or anPersistentActor
if it needs to store its own state (e.g.fromSequenceNr
offset).Please note that Persistence Query is not experimental/may-change anymore in Akka 2.5.0, so you can safely upgrade to it.