Akka Routing: Reply's send to router ends up as dead letters

允我心安 提交于 2019-12-01 21:38:50

Your problem is that your routees are not created by the router itself but by the Akka system with :

system.actorOf(Props[Employee], "Penny")

Therefore context.parent at the employee level will return the Akka system which will redirect your messages to the dead-letters mailbox.

EDIT : According the documentation, see the section Routers, Routees and Senders which states explicitly

Note that different code would be needed if the routees were 
not children of the router, i.e. if they were provided when the router was created.

This is exactly your situation, you are building your employees actors under the system actor and then you pass the ActorRef list as an argument of to the router's constructor.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!