How it works...
In this recipe, we demonstrated how to use Akka persistent query with LevelDB. To do that, we are using the classes, actors, and events we were using in the Handling failure in event sourcing recipe. To begin, we create two FriendActor instances with different persistent IDs, Laura and Maria. With the actors created, we send some AddFriend messages to create some events and we schedule two others to happen in the future. Afterward, we define three different streams. To run the different queries, we need to get readJournal from actor system extension, PersistenceQuery. We call readJournalFor, providing LeveldbReadJournal.Identifier to specify the LevelDB journal reader we want. In case of using other plugins, the provided class ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access