DOC: Minor improvement of remote docs
This commit is contained in:
parent
4f778e826d
commit
1850f6e5b7
4 changed files with 29 additions and 29 deletions
|
|
@ -9,39 +9,42 @@ For an introduction of remoting capabilities of Akka please see :ref:`remoting`.
|
||||||
Preparing your ActorSystem for Remoting
|
Preparing your ActorSystem for Remoting
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
The Akka remoting is a separate jar file. Make sure that you have a dependency from your project to this jar::
|
The Akka remoting is a separate jar file. Make sure that you have the following dependency in your project::
|
||||||
|
|
||||||
akka-remote.jar
|
<dependency>
|
||||||
|
<groupId>com.typesafe.akka</groupId>
|
||||||
|
<artifactId>akka-remote</artifactId>
|
||||||
|
<version>2.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
First of all you have to change the actor provider from ``LocalActorRefProvider`` to ``RemoteActorRefProvider``::
|
To enable remote capabilities in your Akka project you should, at a minimum, add the following changes
|
||||||
|
to your ``application.conf`` file::
|
||||||
|
|
||||||
akka {
|
akka {
|
||||||
actor {
|
actor {
|
||||||
provider = "akka.remote.RemoteActorRefProvider"
|
provider = "akka.remote.RemoteActorRefProvider"
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
After that you must also add the following settings::
|
|
||||||
|
|
||||||
akka {
|
|
||||||
remote {
|
remote {
|
||||||
|
transport = "akka.remote.netty.NettyRemoteSupport"
|
||||||
server {
|
server {
|
||||||
# The hostname or ip to bind the remoting to,
|
hostname = "127.0.0.1"
|
||||||
# InetAddress.getLocalHost.getHostAddress is used if empty
|
|
||||||
hostname = ""
|
|
||||||
|
|
||||||
# The default remote server port clients should connect to.
|
|
||||||
# Default is 2552 (AKKA)
|
|
||||||
port = 2552
|
port = 2552
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
These are the bare minimal settings that must exist in order to get started with remoting.
|
As you can see in the example above there are four things you need to add to get started:
|
||||||
There are, of course, more properties that can be tweaked. We refer to the following
|
|
||||||
|
* Change provider from ``akka.actor.LocalActorRefProvider`` to ``akka.remote.RemoteActorRefProvider``
|
||||||
|
* Add host name - the machine you want to run the actor system on
|
||||||
|
* Add port number - the port the actor system should listen on
|
||||||
|
|
||||||
|
The example above only illustrates the bare minimum of properties you have to add to enable remoting.
|
||||||
|
There are lots of more properties that are related to remoting in Akka. We refer to the following
|
||||||
reference file for more information:
|
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>`_
|
.. literalinclude:: ../../akka-remote/src/main/resources/reference.conf
|
||||||
|
:language: none
|
||||||
|
|
||||||
Looking up Remote Actors
|
Looking up Remote Actors
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ Usage
|
||||||
Configuration
|
Configuration
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
For Akka to know which ``Serializer`` to use for what, you need edit your Akka Configuration,
|
For Akka to know which ``Serializer`` to use for what, you need edit your :ref:`configuration`,
|
||||||
in the "akka.actor.serializers"-section you bind names to implementations of the ``akka.serialization.Serializer``
|
in the "akka.actor.serializers"-section you bind names to implementations of the ``akka.serialization.Serializer``
|
||||||
you wish to use, like this:
|
you wish to use, like this:
|
||||||
|
|
||||||
|
|
@ -90,5 +90,5 @@ which is done by extending ``akka.serialization.JSerializer``, like this:
|
||||||
:include: imports,my-own-serializer
|
:include: imports,my-own-serializer
|
||||||
:exclude: ...
|
:exclude: ...
|
||||||
|
|
||||||
Then you only need to fill in the blanks, bind it to a name in your Akka Configuration and then
|
Then you only need to fill in the blanks, bind it to a name in your :ref:`configuration` and then
|
||||||
list which classes that should be serialized using it.
|
list which classes that should be serialized using it.
|
||||||
|
|
@ -9,11 +9,7 @@ For an introduction of remoting capabilities of Akka please see :ref:`remoting`.
|
||||||
Preparing your ActorSystem for Remoting
|
Preparing your ActorSystem for Remoting
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
The Akka remoting is a separate jar file. Make sure that you have a dependency from your project to this jar::
|
The Akka remoting is a separate jar file. Make sure that you have the following dependency in your project::
|
||||||
|
|
||||||
akka-remote.jar
|
|
||||||
|
|
||||||
In you SBT project you should add the following as a dependency::
|
|
||||||
|
|
||||||
"com.typesafe.akka" % "akka-remote" % "2.0-SNAPSHOT"
|
"com.typesafe.akka" % "akka-remote" % "2.0-SNAPSHOT"
|
||||||
|
|
||||||
|
|
@ -43,7 +39,8 @@ The example above only illustrates the bare minimum of properties you have to ad
|
||||||
There are lots of more properties that are related to remoting in Akka. We refer to the following
|
There are lots of more properties that are related to remoting in Akka. We refer to the following
|
||||||
reference file for more information:
|
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>`_
|
.. literalinclude:: ../../akka-remote/src/main/resources/reference.conf
|
||||||
|
:language: none
|
||||||
|
|
||||||
Types of Remote Interaction
|
Types of Remote Interaction
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ Usage
|
||||||
Configuration
|
Configuration
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
For Akka to know which ``Serializer`` to use for what, you need edit your Akka Configuration,
|
For Akka to know which ``Serializer`` to use for what, you need edit your :ref:`configuration`,
|
||||||
in the "akka.actor.serializers"-section you bind names to implementations of the ``akka.serialization.Serializer``
|
in the "akka.actor.serializers"-section you bind names to implementations of the ``akka.serialization.Serializer``
|
||||||
you wish to use, like this:
|
you wish to use, like this:
|
||||||
|
|
||||||
|
|
@ -89,5 +89,5 @@ First you need to create a class definition of your ``Serializer`` like so:
|
||||||
:include: imports,my-own-serializer
|
:include: imports,my-own-serializer
|
||||||
:exclude: ...
|
:exclude: ...
|
||||||
|
|
||||||
Then you only need to fill in the blanks, bind it to a name in your Akka Configuration and then
|
Then you only need to fill in the blanks, bind it to a name in your :ref:`configuration` and then
|
||||||
list which classes that should be serialized using it.
|
list which classes that should be serialized using it.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue