Merge pull request #18445 from akka/wip-18370-sharding-supervision-patriknw

=cls #18370 Document supervision for Cluster Sharding
This commit is contained in:
Konrad Malawski 2015-09-16 12:59:37 +02:00
commit c57b4e24c8
4 changed files with 91 additions and 0 deletions

View file

@ -241,6 +241,21 @@ using a ``Passivate``.
Note that the state of the entities themselves will not be restored unless they have been made persistent,
e.g. with :ref:`persistence-java`.
Supervision
-----------
If you need to use another ``supervisorStrategy`` for the entity actors than the default (restarting) strategy
you need to create an intermediate parent actor that defines the ``supervisorStrategy`` to the
child entity actor.
.. includecode:: ../../../akka-cluster-sharding/src/test/java/akka/cluster/sharding/ClusterShardingTest.java#supervisor
You start such a supervisor in the same way as if it was the entity actor.
.. includecode:: ../../../akka-cluster-sharding/src/test/java/akka/cluster/sharding/ClusterShardingTest.java#counter-supervisor-start
Note that stopped entities will be started again when a new message is targeted to the entity.
Graceful Shutdown
-----------------