我正在使用Akka持久性构建应用程序。
我必须正确检测并处理持久性故障。这怎么可能?它会抛出任何持久性异常吗?
这是我现在所拥有的
override def receiveRecover: Receive = {
...
}
override def receiveCommand: Receive = {
case WorkIsDone(workerId, workId, result) =>
persist(WorkDone(workId, result)) { event =>
workData = workData.updated(WorkDone(workId, result))
}
...
}
答案 0 :(得分:3)
发生错误时会抛出onPersistFailure
有关akka persistence failure section的更多信息,并在发生错误时查看不同的处理程序Persistence_status_handling