-1

Let's say we have two Nodes. Node 1 contains Actor A, Node 2 contains Actor B.

Assume that the communication between the two actors are implemented like so:

val B_ref = sharding.entityRefFor(BTypeKey, B_ID)

//inside A

context.ask(B_ref, message(replyTo =_) {
   //... Translate B reply to A command
}

After the message was sent, Node 1 dies and actor A is relocated. What happens to the "Future" of the Ask that was waiting for B's reply? I assume that since the Node died, the Future no longer exists. In effect, B's reply will fall to a deadletter.

Is my theory correct?

Rey Pader
  • 83
  • 1
  • 5

1 Answers1

0

context.ask doesn't result in a future, but an adapted message. Since the ActorContext doesn't know that this actor is just an incarnation of a cluster-sharded entity, your basic intuition is in effect: the reply from B will not be delivered.

Levi Ramsey
  • 18,884
  • 1
  • 16
  • 30