These are chat archives for akkadotnet/akka.net

24th
Feb 2016
Damian Reeves
@DamianReeves
Feb 24 2016 00:27
I asked this question before and don't think I got an answer... is there any plans in the works for a named pipes transport layer for Akka?
If not can someone with knowledge in the area provide a general estimate in how difficult rolling my own would be
sgulci
@sgulci
Feb 24 2016 08:40
when i add new crawler service to web crawler sample , on web ui DEBUG: [akka://webcrawler/user/tasker] has 0 routees:, and nothing happen, what is missing?
Yin Zhang
@melcloud
Feb 24 2016 08:51
akkadotnet/akka.net#1017. @DamianReeves
Zetanova
@Zetanova
Feb 24 2016 10:47
Is there a good book for akka/actor pattern that describes common problems?
?
Marc Piechura
@marcpiechura
Feb 24 2016 10:57
@Zetanova I bought this one https://www.manning.com/books/reactive-design-patterns but haven't looked into it, but since it's recommend in the docs I hope it will be interesting ;)
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 11:17
@Silv3rcircl3 I'm in halfway of reading it. Learned few new things, however it seems to be more showing the overall mindset of reactive distributed programming
Marc Piechura
@marcpiechura
Feb 24 2016 11:21
cool, perfect then for me, since I haven't build distributed applications :)
Arjen Smits
@Danthar
Feb 24 2016 11:21
I got this one. http://www.amazon.com/Patterns-Enterprise-Application-Architecture-Martin/dp/0321127420 Have to reread it in the future. Contains quite a few messaging patterns. But its abit more dated
Zetanova
@Zetanova
Feb 24 2016 11:41
@Silv3rcircl3 thx
voltcode
@voltcode
Feb 24 2016 11:45
there are some good books on Erlang OTP @Zetanova . Certainly not Akka but definitely about the Actor Model.
Zetanova
@Zetanova
Feb 24 2016 11:58
Thx, will look on them, i am currently mostly interested in actor interactions, beside a ProcessManager. Exp, I have my troubles to wait on responses and processing new "things" meanwhile, Error/Failure patterns or using child-actors for tasks
Zetanova
@Zetanova
Feb 24 2016 12:05
one other thing, how to catch a death-letter message in the parent actor?
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 12:07
@Zetanova good option is to route messages through the parent actor
Zetanova
@Zetanova
Feb 24 2016 12:10
@Horusiath Yes, that what i am doing and thats the problem. I need to catch the deathletter message to load the child again, if it was unloaded (why ever)
@Horusiath Cant use ActorRefs or Paths or even Sender
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 12:12
but if you're routing messages to child through its parent, you should never have deadletter on the first place, as you can just check if Context.Child(actorName) is not ActorRefs.Nobody and create it if necessary
you can eventually combine Context.System.EventStream.Subscribe(Self, typeof(DeadLetter)) with Receive<DeadLetter>(letter => letter.Recipient.Path.Parent.Name == Self.Path.Name, letter => /* logic */) if necessary, but I think collecting every single deadletter from event bus is not nice
Zetanova
@Zetanova
Feb 24 2016 12:16
@Horusiath If the child is requesting something from a other actor, the response needs to go to the parent too. It complicates things, if the parent could catch this message he could create the child and route the message to it. To send the response to the child directly it needs always be loaded or need to track the "operation" to not passivate itself
Its valid for a AR and ProcessManager if the get unloaded on long running tasks or over process restarts. I am allways passing the AR-Id's arround, but cant never make a request to a stupid actor that dont know anything about a coordinator and sends only some messages back.
Zetanova
@Zetanova
Feb 24 2016 12:22
If in this messages the recipient-id is not included the router would be unable to route them
my idea is that if it goes to the deathletter the router can catch the message and resolve the recipient-id by the ActorPath
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 12:26
@Zetanova can't you use cluster sharding for that?
Zetanova
@Zetanova
Feb 24 2016 12:29
@Horusiath dont know, i want only resolve the problem that when a AR is sending to a SchedulerActor a PingMeInOneDay message, it will get the Pong-Message back, event if the application restarts in the period.
i realy dont know, why i am backing so my tippings, in this chat
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 12:32
cluster sharding is build generally for cases like yours, to manage actors lifecycle automatically, route messages to them and create when necessary
Arjen Smits
@Danthar
Feb 24 2016 12:58
@Zetanova why not put the 'response' addres in the message you are sending to your SchedulerActor ? Then you can let your schedulerActor send its message back to your coordinator. Which will delegate it to its child, and thus can handle child creation if need be.
Zetanova
@Zetanova
Feb 24 2016 13:11
@Danthar Yes, that is what i am doing, but it is just a pain, why should the scheduler be aware of the coordinator? It just need to send something back like a Success.Instance. With this pattern the Sucess.Instance would not working and the scheduler needs to use a SuccessWithRecipientId-message, mybe he makes a recursive call to itself and so it needs to carry the recipient-id with it.
Arjen Smits
@Danthar
Feb 24 2016 13:23
Ah yep thats true.
Bulent Coskun
@BCoskun
Feb 24 2016 15:23
Hi All, Time to time I am getting "Message DeathWatchNotification ManagerActor/a$ to ManagerActor/a$ was not delivered … “ type of messages. Is there any way that I can see what was the message not been delivered?
Zetanova
@Zetanova
Feb 24 2016 15:33
Like @Horusiath wrote some hours above Context.System.EventStream.Subscribe(Self, typeof(DeadLetter))
@BCoskun
Bulent Coskun
@BCoskun
Feb 24 2016 15:33
@Zetanova Thanks
Zetanova
@Zetanova
Feb 24 2016 16:05
@Horusiath // send message to entity through shard region region.Tell(new Envelope(shardId: 1, entityId: 1, message: "hello"))
seams its the same technic, only that the message is routed with the help of the an envelope
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 17:27
@Zetanova ??
sorry, but I'm out of context
Zetanova
@Zetanova
Feb 24 2016 17:34
@Horusiath Akka.Cluster.Sharding it seems on the first look to work with coordinator/router and Envelope's (or recipient-id inside the messages) Its more or less what i currently have. What i am searching for is a way to get the message send to a non exsisting child to the parent. Could it be archived with the help of some kind of superviser strategy?
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 18:00
@Zetanova this is what region.Tell(new Envelope(shardId: 1, entityId: 1, message: "hello")) does - it sends message to actor identified by shard/entity, and if it doesn't exists, it creates it. Remember that if you need to use Scheduler, you can also schedule an Action delegate, not only a message to be sent.
Zetanova
@Zetanova
Feb 24 2016 18:02
@Horusiath What i want is that Sender.Tell(Success.Instance); would reload the actor, if he allready gone away
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 18:07
so you could pass actorRef.Tell(new Request(replyTo: Self.Path.Name), Context.Parent) to actorRef responsible for emitting success message, and then from that actor Sender.Tell(new Success(request.ReplyTo))
or when using cluster sharding:
var path = Sender.Path;
shardRegion.Tell(new Envelope(shardId: path.Parent.Name, entityId: path.Name, message: Success.Instance))
Zetanova
@Zetanova
Feb 24 2016 18:14
@Horusiath that is exactly what i want to reduce away. I am trying to make a dump actor that just reply as the request whould come from an other dump actor. 99,999% of the time the sender would still be around, but if its not alive anymore it should be loaded from the coordinator.
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 18:16
so you could still use DeadLetter listener trick
Zetanova
@Zetanova
Feb 24 2016 18:19
And there is nothing with some supervisor strategy? I could imagine to create a basic actor that will instantly fail to kickstart the supervisor strategy.
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 18:23
supervisior strategy triggers when actor has failed, but not when there was no actor ;)
Zetanova
@Zetanova
Feb 24 2016 18:27
yes, can i change the behaivior for a path ?
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 18:28
what do you mean by that?
Zetanova
@Zetanova
Feb 24 2016 18:28
if there is no actor that it would be threated as the actor failed on the message
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 18:29
I don't think so
Zetanova
@Zetanova
Feb 24 2016 18:30
then the coordinator could handle it as a supervisor what his mainrole is, that would be optimal
Alex Achinfiev
@aachinfiev
Feb 24 2016 19:22
Hi folks. If I spawn a child and use Context.Stop to stop it while parent does Context.Watch and gets terminated I can log what happened the way I want. However, if I spawn child as a RoundRobinPool router and terminate child I get message DeathWatch notification was not delivered in my log. How does the deathwatch message propagate from a child inside a router? Thanks.
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 21:04
@aachinfiev are you watching on router, or its children?
Alex Achinfiev
@aachinfiev
Feb 24 2016 21:43
@Horusiath router
Do I have to watch each child?
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 21:44
this is how Context.Watch works
AFAIK, there should be a way to broadcast that request to all children
Alex Achinfiev
@aachinfiev
Feb 24 2016 21:47
So does the terminate message from child try to propagate to router first and then router sends it up? Or terminate from child is dead letter and when router terminates with 0 children it sends terminate to parent?
Bartosz Sypytkowski
@Horusiath
Feb 24 2016 21:47
You may send GetRoutees request, it will then respond with Routees message containing actor refs for all children. You may use Context.Watch on them.
I don't know about terminated message propagation - @rogeralsing ?
from what I see Terminate message is not propagated from the router