处理akka持久性故障

时间:2015-09-25 04:48:51

标签: scala akka akka-persistence

我正在使用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))
        }

...     
}

1 个答案:

答案 0 :(得分:3)

发生错误时会抛出onPersistFailure

有关akka persistence failure section的更多信息,并在发生错误时查看不同的处理程序Persistence_status_handling