Skip to content

How to implement PersistenceQuery of ReadJournalFor in Akka.Net Hosting Model #6062

Answered by Aaronontheweb
shawndewet asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by shawndewet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants