Reputation: 715
I am having some issues with persistent actors which use the Postgres plugin where it seems the actors never manage to reconnect to the database after a database outage.
The persistent actors are stopped after 1 minute of inactivity so I am getting new actors all the time, but they never seem to be able to reconnect.
Restarting the pod the actor system is running on fixes the problem.
I can kind of replicate this locally by :
I then start the database without restarting the actor system and send a new message which spawns a new persistent actor which fails with the same database error.
Is there some way of forcing Akka.Persistence to reconnect?
Upvotes: 1
Views: 141
Reputation: 8404
There are two ways you can go about solving this problem:
BackoffSupervisor
- which will recreate the actor according to an exponential backoff schedule.BackoffSupervisor
but is able to save messages that weren't successfully persisted provided that you implement the messaging protocol it expects. The documentation for that feature is here: https://devops.petabridge.com/articles/state-management/akkadotnet-persistence-failure-handling.htmlUpvotes: 0