How to implement PersistenceQuery of ReadJournalFor in Akka.Net Hosting Model #6062
-
I've worked through the documentation on Akka.Net PersistenceQuery here, but I'm struggling to figure out how I would hook up any of those queries inside an ASP.Net6 Blazor Server startup pipeline using the new Akka.Net Hosting model. What I have in mind is to Has anyone done this, and if so, please can you provide me with some guidance in this regard? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
To hook up Akka.Persistence.Query inside Akka.Hosting: I always have any persistent query owned by an actor who is responsible for the lifecycle of that query - that way if there's a problem with the query execution it's easy for me to supervise it. There's nothing special required with Akka.Hosting needed to do this - all of the correct dependencies needed to run Akka.Persistence.Query for SQLServer are already running behind the scenes when you use the Akka.Persistence.SqlServer.Hosting plugin. |
Beta Was this translation helpful? Give feedback.
To hook up Akka.Persistence.Query inside Akka.Hosting:
https://github.com/petabridge/akkadotnet-code-samples/blob/0408cdd9a8891df95d75041d0046eb1fb704a435/src/clustering/sharding-sqlserver/SqlSharding.Host/Actors/ProductIndexActor.cs#L64-L76
I always have any persistent query owned by an actor who is responsible for the lifecycle of that query - that way if there's a problem with the query execution it's easy for me to supervise it. There's nothing special required with Akka.Hosting needed to do this - all of the correct dependencies needed to run Akka.Persistence.Query for SQLServer are already running behind the scenes when you use the Akka.Persistence.SqlServer.Hosting plugin.