I'm using Akka 2.5.2 with Scala 2.12.2.
The sharding doc mentions that in order to have crashed/rebalanced shards recovering their entities, the ShardRegion.ExtractShardI
must handle the ShardRegion.StartEntity
message.
And if an entity itself needs to recover its internal state, it must implement PersistenceActor
. For this to work, the entity must have a unique persistenceId
.
The problem is, when an entity is restarted, how does it find out its persistenceId
? Is this passed in by the ShardRegion
actor?