Ticket 1546: correcting remote docs.

This commit is contained in:
viktorklang 2011-12-21 23:33:13 +01:00
parent daf279f4ef
commit b481db3952

View file

@ -1,4 +1,3 @@
.. _remoting-scala:
#################
@ -29,14 +28,16 @@ First of all you have to change the actor provider from ``LocalActorRefProvider`
After that you must also add the following settings::
akka {
server {
# The hostname or ip to bind the remoting to,
# InetAddress.getLocalHost.getHostAddress is used if empty
hostname = ""
remote {
server {
# The hostname or ip to bind the remoting to,
# InetAddress.getLocalHost.getHostAddress is used if empty
hostname = ""
# The default remote server port clients should connect to.
# Default is 2552 (AKKA)
port = 2552
# The default remote server port clients should connect to.
# Default is 2552 (AKKA)
port = 2552
}
}
}
@ -46,8 +47,19 @@ reference file for more information:
* `reference.conf of akka-remote <https://github.com/jboner/akka/blob/master/akka-remote/src/main/resources/reference.conf#L39>`_
Using Remote Actors
^^^^^^^^^^^^^^^^^^^
Looking up Remote Actors
^^^^^^^^^^^^^^^^^^^^^^^^
``actorFor(path)`` will obtain an ``ActorRef`` to an Actor on a remote node::
val actor = context.actorFor("akka://app@10.0.0.1:2552/user/serviceA/retrieval")
As you can see from the example above the following pattern is used to find an ``ActorRef`` on a remote node::
akka://<actorsystemname>@<hostname>:<port>/<actor path>
Creating Actors Remotely
^^^^^^^^^^^^^^^^^^^^^^^^
The configuration below instructs the system to deploy the actor "retrieval” on the specific host "app@10.0.0.1".
The "app" in this case refers to the name of the ``ActorSystem``::
@ -67,14 +79,6 @@ actor created above you would do the following::
val actor = context.actorFor("/serviceA/retrieval")
This will obtain an ``ActorRef`` on a remote node::
val actor = context.actorFor("akka://app@10.0.0.1:2552/user/serviceA/retrieval")
As you can see from the example above the following pattern is used to find an ``ActorRef`` on a remote node::
akka://<actorsystemname>@<hostname>:<port>/<actor path>
Serialization
^^^^^^^^^^^^^