concept remote actor in category akka

This is an excerpt from Manning's book Reactive Applications with Akka .NET.
Let’s consider for a moment the actors you deployed into your system. They required no customization. But the simplest actor configuration will fail when you deploy more-complex actors. For example, how do you handle a case in which you want an actor to distribute its messages to other actors, thereby increasing the amount of work that can be done in parallel? And how does an actor handle a failure? These are just two of the scenarios you’ll configure in your actors. In later chapters, you’ll see more uses for actor configuration when we look at remote actors and failure handling. In this chapter, we’ll look at creating more-complex actors, such as those with many dependencies.
When an actor on a remote machine receives a message, it replies in the same way that you’ve seen. Akka.Remote then deals with handling remote senders and serializing them so you can address them in the usual way. You can perform request-response queries against remote actors by using Ask. But because a network connection links remote actors, there’s the possibility of message loss and of Ask not receiving a response, causing it to block indefinitely. So you specify a timeout period, after which the call will throw an exception. The following code says that a response from a remote actor is expected, but if that doesn’t happen within 20 seconds, an exception is thrown:

This is an excerpt from Manning's book Akka in Action.
Akka provides a remoting module (which we’ll discuss in chapter 6) that enables the transparency you seek. Akka passes messages for a remote actor on to a remote machine where the actor resides, and passes the results back across the network.
The only thing that has to change is how the reference to remote actors is looked up, which can be achieved solely through configuration, as you’ll see later. The code stays exactly the same, which means that you can often transition from scaling up to scaling out without having to change a single line of code.
The flexibility of resolving an address is heavily used in Akka, as we’ll show throughout this book. Remote actors, clustering, and even the test toolkit use this flexibility.
Listing 6.7. Highlights from the core actors
object SingleNodeMain extends App #1 with Startup { #2 #3 val api = new RestApi() { #4 #5 def createBoxOffice: ActorRef = system.actorOf(BoxOffice.props, BoxOffice.name) #6 } startup(api.routes) } object FrontendMain extends App #7 with Startup { #8 #9 val api = new RestApi() { #10 #11 def createPath(): String = #12 def createBoxOffice: ActorRef = { val path = createPath() system.actorOf(Props(new RemoteLookupProxy(path)), "lookupBoxOffice") #13 } } startup(api.routes) } object BackendMain extends App with RequestTimeout { #14 #15 system.actorOf(BoxOffice.props, BoxOffice.name) #16 } #1 - Snippet from SingleNodeMain #2 - Startup of HTTP server; binding routes has been moved to a Startup trait. #3 -.. code omitted reading config and creating actor system #4 - Creating an anonymous class from the RestApi trait, setting up how the BoxOffice must be created #5 -.. code omitted #6 - Creates BoxOffice as before #7 - Snippet from FrontendMain #8 - Startup of HTTP server; binding routes has been moved to a Startup trait. #9 -.. code omitted reading config and creating actor system #10 - Creating an anonymous class from the RestApi trait, setting up how the BoxOffice must be created #11 -.. code omitted reading config and creating actor system #12 -.. code omitted creating path to the remote actor #13 - Lookup the BoxOffice on the remote node #14 - Snippet fromBackendMain #15 -.. code omitted reading config and creating actor system #16 - Creates a top-level boxoffice actor on backend !@%STYLE%@! {"css":"{\"css\": \"font-weight: bold;\"}","target":"[]"} !@%STYLE%@!
Losing messages becomes an issue when you’re using remote actors. With remote actors, it’s a lot more likely for a message delivery failure to occur, especially when an intermediate unreliable network is involved. If someone unplugs an Ethernet cable, or a power failure shuts down a router, messages will be lost. To solve this problem, the ReliableProxy was created. This makes sending messages using remote actors almost as reliable as sending local messages. The only consideration is that critical errors in the JVMs of both the sender and receiver can negatively influence the reliability of this channel.