How would I use Persistence ReadJournal from the current running actor system #7188
-
When I am going through the documentation I see https://getakka.net/articles/persistence/persistence-query.html specific SQL based ReadJournals. I am trying to build an Persistence Actor without knowledge of the persistence layer used. For testing for example I am using the In Memory Journal using "Persistence.Instance.Apply(Sys).JournalFor(string.Empty);". Is their any way without to get a ReadJournal from the currently enabled Persistence provider? I am trying to build an actor that processes all events and based on logic build a command into another actor. Basically a rules engine to know what commands to provide actors doing basic logic. Is there a way to get this working? Context.System.GetReadJournal (or something like that)? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I am not sure this is exactly the same, but I had an actor once that would behave differently based on the type of persistence. I was using: |
Beta Was this translation helpful? Give feedback.
-
This is what I came up with at this moment. I need to debug if this works, but I would say it should ... ?
|
Beta Was this translation helpful? Give feedback.
-
This worked for me. The actor props is taking in a
|
Beta Was this translation helpful? Give feedback.
This worked for me. The actor props is taking in a
IAllEventsQuery journal
which is provider agnostic