【发布时间】:2019-12-06 06:06:59
【问题描述】:
我已阅读此文档 https://doc.akka.io/docs/akka/current/general/message-delivery-reliability.html#dead-letters,其中说:
演员可以在事件流上订阅 akka.actor.DeadLetter 类,请参阅事件流了解如何做到这一点。
在 Event Stream 文档中:https://doc.akka.io/docs/akka/current/event-bus.html#event-stream,示例代码似乎是经典 Akka,包是 akka.actor.ActorSystem 而不是 akka.actor.typed.ActorSystem:
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
final ActorSystem system = ActorSystem.create("DeadLetters");
final ActorRef actor = system.actorOf(Props.create(DeadLetterActor.class));
system.getEventStream().subscribe(actor, DeadLetter.class);
但在 Akka Typed 中,akka.actor.typed.ActorSystem.eventStream() 中没有名为 subscribe() 的方法。
【问题讨论】:
标签: akka actor dead-letter akka-typed actorsystem