Aaronontheweb on dev
Remove string interpolation fro… (compare)
1<Wire.Surrogate>, Boolean, System.Collections.Generic.IEnumerable
1<Wire.Converters.ValueSerializerFactory>)'.@amichel if you're not using snapshots you can just change behavior using Become
as part of state recovery. If you're using snapshots, then you can include current behavior i.e. as enum, and when snapshot offer will be loaded, just switch behavior depending on it. Other option would be to set receive method as delegate and persist it along with the state itself, but this require you to use serializer that is able to work with delegates (i.e. Wire/Hyperion should be ok).
Regarding stashed messages I don't know if there are any build in mechanics there - we could possibly make a PR for that. But since persisting messages themselves usually cripples performance, I think the easiest way here is to push stash content back to the shard. First thing, that came out to my head look like that:
// we need custom stop message (can be set in shard region)
// because PoisonPill will immediatelly terminate an actor
Command<CustomStop>(_ =>{
var envelopes = Stash.ClearStash();
foreach (var env in envelopes){
/// retransmit messages back to myself using cluster sharding mechanics
var shardId = Self.Path.Parent.Name;
var entityId = Self.Path.Name;
/// ShardEnvelope is used by shard region MessageExtractor implementation
shardRegion.Tell(new ShardEnvelope(shardId, entityId, env.Message), env.Sender);
}
});
/user/actorA
on node 1 and /user/actorA
on node 2 are two different paths