These are chat archives for akkadotnet/akka.net

3rd
Apr 2018
Hassan Hashemi
@HassanHashemi
Apr 03 2018 06:24
guys, what do you recommend for a an instant messaging app? AKKA or servicebus?
Michal Pawluk
@nekomatic
Apr 03 2018 07:38
@HassanHashemi it is hard to say without knowing the actual requirements. If you are fine with a third-party managed service bus, some services out there support most common IM functionality pretty much out of the box. Going for Akka may prove to be the 'hard way', but certainly worth trying.
Hassan Hashemi
@HassanHashemi
Apr 03 2018 07:46
@nekomatic thanks, will keep that in mind.
Paweł Bańka
@pmbanka
Apr 03 2018 12:16
Hi everyone :) After yet another failure in persistence actors related to snapshots, I started looking into implementing some self-healing logic, that would delete snapshots when LoadSnapshotFailed occurs. Unfortunately, it seems that I cant't use OnRecoveryFailure call to clear snapshots, since the actor is being stopped just after calling it (https://github.com/akkadotnet/akka.net/blob/838971a893d630bb18aeb5d6ca263e27de856a34/src/core/Akka.Persistence/Eventsourced.Recovery.cs#L111) so the clear snapshots command won't get processed. This creates a chicken-egg problem - in order to clear snapshots via command, I need to have a persistent actor created, but it won't get created until I clear the snapshots :) So my question is:
  1. Is the whole idea of automatic snapshots deletion not good/dangerous for some reason? (I know that it would fail if we deleted the events from before latest snapshot, but we don't do that.)
  2. If not, then is there a way to get what I want that I didn't think about?
Aaron Stannard
@Aaronontheweb
Apr 03 2018 13:48
Is the whole idea of automatic snapshots deletion not good/dangerous for some reason?
yeah, don't want to do anything like that without the user explicitly agreeing to do it
snapshots can serve other purposes too, such as being able to restore an entity to a specific point in time
so what's the issue you're having with snapshots @pmbanka ?
Paweł Bańka
@pmbanka
Apr 03 2018 13:52
@Aaronontheweb ah, it is just that we have a default serializer for snapshots, and now that I wanted to rename the assembly that holds some data that goes into snapshots the persistent actors go boom during creation. The workaround is to just delete snapshots (which we can do, they only serve for some optimisation in some cases), but I was wondering if I could have something that would fix itself.
I also noticed that the DeleteSnapshots command is not handled by the persistent actor, but by the underlying SnapshotStore, so I kinda can do what I wrote about - send the message in OnRecoveryFailure, then eventually (after some restarts) the actor will load only from events. But it feels hacky, so I figured I'd ask if anyone else had similar situation.
Hyungho Ko
@hhko
Apr 03 2018 15:11
Hi. I'm using ".WithRouter(FromConfig.Instance);" from app.config for router.
this is my sample code.
Aaron Stannard
@Aaronontheweb
Apr 03 2018 15:11
@pmbanka yeah - I dunno if it's "hacky" necessarily
Hyungho Ko
@hhko
Apr 03 2018 15:11
When using ".WithRouter(FromConfig.Instance);" is wrong.
but when using ".WithRouter(new RoundRobinPool(3)); " is good.
what's the problem?
Aaron Stannard
@Aaronontheweb
Apr 03 2018 15:12
havent looked at your source yet @hhko
but are you sure that your App.config has the correct path setup for this routeR?
Hyungho Ko
@hhko
Apr 03 2018 15:13
deployment {
/Parent/Child {
router = round-robin-pool
nr-of-instances = 3
}
}
this is my app.config.
Aaron Stannard
@Aaronontheweb
Apr 03 2018 15:14
got it
and so this is when you're deploying the Child actor, the source code above?
Hyungho Ko
@hhko
Apr 03 2018 15:14
yes.
The HelloworldRouter.zip file is my sample code.
I think the top level actors from app.config for router is good.
but the child level actors from app.config fro router is wrong.
Aaron Stannard
@Aaronontheweb
Apr 03 2018 15:47
WebCrawler and some of our other samples are able to work fine with router child deployments\
and we have a test case that checks for those specifically
so I'm sure it's a configuration issue with your app
not a bug with the framework\
Martin Clode
@MClode
Apr 03 2018 19:02
Any tips for adding a print to a stream of how many things are happening per second, for monitoring how things are going?
Marc Piechura
@marcpiechura
Apr 03 2018 19:25
@martinclode for a simple linear flow you could use the AlsoTo stage to send elements to another flow and accumulate them
If you have some third party monitoring tool a simple Select or Log stage should do it too