How do you tell an actor to successfully send a message to another mailbox?

here is a scenario for my mission critical application: Actor A does some resource intensive work and then sends a message to Actor B in another unix physical block. B addresses external elements of the network and can process the message for a long time. B then sends back the result of the process back to A.

Q1: A searches for B using the B-path. if B unix box is omitted, or B is not already running, the search will fail. akka doc says dead text is returned like ref. how can I verify that this is a normal referent or a refull like the documentation returned?

Q2: Suppose the normal actor ref of B is a return. if A uses B.tell () to send msg to B and msg cannot get to B's mailbox B which is persistent, how do I know this happened so that A can send MSN message to local actor C with persistent mail box? C will try to deliver the message to B forever until it succeeds.

+3


source to share


1 answer


Answer 1:

system.actorFor(someRemotePath)

always gives you a remote referent, and there is no way to know by checking this, whether it indicates to the actor that it exists or can be reached. The only way to know if there is an actor in this URI is to send a message: if you get a response, then it will be alive, if after some reasonable time there is no response, you have to assume that it is omitted and / or try again, although it could very well happen that the reply message was lost due to firewall reboot or something else.

Answer 2:



Your C actor is the solution to all your problems: you have to always send to C, and make sure the message is eventually confirmed by the remote player. Akka has no way of knowing if a given message has been delivered to the mailbox, because that doesn't mean the actor can successfully process the message anyway.

In general, I recommend reading the message delivery guarantees documentation , especially before running mission-critical applications.

+3


source







All Articles