2
나는 PersistenceActor
을 가지고 있는데, 메시지를 바탕으로 preRestart
메서드를 사용하여 무언가를하고 싶습니다. 일반 배우를위한 preRestart
메서드에 전달 된 메시지가있는 한, 쉽게 될 것이라고 :Akka 지속성에서 다시 시작하는 메시지를 얻는 방법
def preRestart(reason: Throwable, message: Option[Any])
그러나 때마다 None
메시지 속성으로 전달되기 때문에, 그런 식으로 할 수없는 PersistentActor
합니다. 그것은 Eventsourced.scala
코드의 조각에 의해 발생합니다 :
override protected[akka] def aroundPreRestart(reason: Throwable, message: Option[Any]): Unit = {
try {
internalStash.unstashAll()
unstashAll(unstashFilterPredicate)
} finally {
message match {
case Some(WriteMessageSuccess(m, _)) ⇒
flushJournalBatch()
super.aroundPreRestart(reason, Some(m))
case Some(LoopMessageSuccess(m, _)) ⇒
flushJournalBatch()
super.aroundPreRestart(reason, Some(m))
case Some(ReplayedMessage(m)) ⇒
flushJournalBatch()
super.aroundPreRestart(reason, Some(m))
case mo ⇒
flushJournalBatch()
super.aroundPreRestart(reason, None)
}
}
}
None
이 원본 메시지를 잃고, 거기에 전달되는 이유
사람이 알고 있나요?