发送给正在部署的 Actor 的消息会发生什么情况?

What happens to messages sent to Actors that are being deployed?

我有一个很简单的问题,但是我在网上没有找到任何东西(可能是我不知道怎么搜索)。

如果我部署一个 actor (actorSystem.actorOf ...) 并立即向它发送一条消息,如果 Actor 尚未部署,消息将在 "special" 中排队队列或将消息发送到 DeadLetters?

查看邮箱文档的底部。您的猜测是正确的,在邮箱准备好之前,邮件会存储在一个特殊的队列中。

In order to make system.actorOf both synchronous and non-blocking while keeping the return type ActorRef (and the semantics that the returned ref is fully functional), special handling takes place for this case. Behind the scenes, a hollow kind of actor reference is constructed, which is sent to the system’s guardian actor who actually creates the actor and its context and puts those inside the reference. Until that has happened, messages sent to the ActorRef will be queued locally, and only upon swapping the real filling in will they be transferred into the real mailbox.

Actor mailboxes