These are chat archives for akkadotnet/akka.net
If you need something like message processing retries, you could i.e.
PreRestart(exception, message)method and put that message (which caused an exception to occur) at the end of the actor mailbox i.e.
Self.Forward(message), so it will be processed later on.
AtLeastOnceDeliveryActorfrom Akka.Persistence module). This actor will try to redeliver a message in time intervals until it gets confirmed. So if your actor will crash during message processing, it just won't send a confirmation, and message will be send after some time.
Second option is safer (and more complex) as it can handle scenarios like crash of the machine, actors are working on.
But in both cases you must ensure that your actor processes messages in indempotent manner. This means, no matter how many times an actor receives the same message, the result must be the same as if it was only received once.
@corneliutusnea I set up Visualizer according to the doc file but don't seem to get a Web site on localhost:8085 (I created URL reservation for that).
I had the same problem when I tried some time back.
var webVisualizer = new WebApiVisualizer(); ActorVisualizeExtension.InstallVisualizer(_system, webVisualizer); webVisualizer.Start();
var actorSystem = ActorSystem.Create("PersistenceActorSystem"); var actor = actorSystem.ActorOf(Props.Create<ParentActor>(), "ParentActor"); var webVisualizer = new WebApiVisualizer(); ActorVisualizeExtension.InstallVisualizer(actorSystem, webVisualizer); webVisualizer.Start(); Console.Read(); actorSystem.WhenTerminated.Wait(); Console.WriteLine("Actor system shutdown...");
var now = DateTime.UtcNow; //has Kind UTC here var source = new MemoryStream(); var w = new StreamWriter(source); var s = new Wire.Serializer(new SerializerOptions()); s.Serialize(now, w.BaseStream); source.Position = 0; var newdate = s.Deserialize(source); //has Kind unspecified here
hostnamewill be used for both