These are chat archives for akkadotnet/akka.net

17th
Oct 2017
Saepul Ramdani
@blackclavus
Oct 17 2017 03:07
guys, quick question, is there anyway to write log into text file but only when error or warning happen?
jalchr
@jalchr
Oct 17 2017 06:03
@Horusiath I have the "router" setup already working fine in my cluster. Once I added the "Persistence" features, it didn't work as expected. Somehow the Deliver method fails to "use" the router.
jalchr
@jalchr
Oct 17 2017 06:21
Another question, Is there a way to 'delete' a message from a snapshot ... ?
I have a problem (?) where everything works fine, and the message is acknowledged and I'm done with it. If I restart the app, this "already-processed" message is reloaded from the snapshot and starts processing again.
Command<ReliableDeliveryAck<StartJob>>(ack =>
            {
                ConfirmDelivery(ack.MessageId);
                // DeleteSnapshots(new SnapshotSelectionCriteria(ack.MessageId)); // <---------------  delete this message ?!
            });
Arjen Smits
@Danthar
Oct 17 2017 06:49
@jalchr No. Delete the snapshot.
But you can ask your persistentActor if it is in recovering state
A simple If statement in your Command<> handlers would help in determining if it should really process the message or only update internal state
And in general, if you are loading your snapshot. You are only loading internal state. You should not actually process stuff untill your journal is done recovering
jalchr
@jalchr
Oct 17 2017 08:55
@Danthar Appreciate your explanation. Can you elaborate ? sample code (for the if statement) perhaps ?
Arjen Smits
@Danthar
Oct 17 2017 13:04

@jalchr well in the scenario of processing your snapshot:

Recover<SnapshotOffer>(s => {
                YourActorState state;
                if ((state = s.Snapshot as YourActorState ) != null)
                    this.State = state;
});

And if you use the journal functionality you can use the IsRecovering property of your actor to check. But while in recovery state, you would typically use the OnRecover override method.

See the docs for more in depth information: http://getakka.net/articles/persistence/event-sourcing.html
Thomas Tomanek
@thomastomanek
Oct 17 2017 13:11
can anyone shed some light on what WriterGuid is supposed to be in IPersistentRepresentation.cs? Seems to be new but no docs on the param
Bart de Boer
@boekabart
Oct 17 2017 13:26
@Aaronontheweb opinion on #3157 ?
Carey Free
@Cawifre
Oct 17 2017 14:03
Akka.Logger.Serilog.SerilogLogger.GetFormat() uses "{Message}" as the message template in the case of trivial log events. This produces output where the entire logged message is wrapped in quotes. Using "{Message:l}" would format the property as a "literal" (special Serilog extension of standard format strings) and produce output where the logged message is not wrapped in quotes.
("{SomeStringProperty:l}" seems to be broken at the moment, but that should be fixed... serilog/serilog#1045 )
I think GetFormat() should be changed. Thoughts?
fleed
@fleed
Oct 17 2017 14:23
@Aaronontheweb i have two applications A and B and I’d like to have those actor systems communicating with each other. I have concerns about messaging within actor systems themselves (A.actor1 -> A.actor2). Is the communication equally efficient (just in-process transfers)?
Thank you
Arjen Smits
@Danthar
Oct 17 2017 14:26
@fleed Communication inside the actor system is extremely fast. No network stuff comes into play there.
fleed
@fleed
Oct 17 2017 14:28
thank you @Danthar !
Aaron Stannard
@Aaronontheweb
Oct 17 2017 14:40
@boekabart I agree with the poster
we should do a deep copy there
Carey Free
@Cawifre
Oct 17 2017 17:29
@Aaronontheweb Thoughts on the above? Should I make an issue? Make a pull request? Keep my opinions to myself?
Aaron Stannard
@Aaronontheweb
Oct 17 2017 17:36
@Cawifre I'd submit a PR
so the users who use Serilog more aggressively can comment on it
I'm still a bit of a Serilog newbie
Carey Free
@Cawifre
Oct 17 2017 17:57
@Aaronontheweb done