Hi! Thanks for your help, it pointed me into the right direction. I did not remember that when using context.actorOf then the created actor was relative to current actor context, it has all the sense in the world. I have read the docs but i guess i need more practice to connect the ideas. I realized that the actor name was "$a" as it was created dynamically by the "pool" I configured. In fact then i realized that there is no reason for the actor "recommendations" (which is in fact a group that points to a remote actor) be a child of a "frontActor". As I wanted that all the instances of frontActor that are being created by the pool re use the "recommendations" group to send messages to the remote actor system. So now i have updated the code so "recommentations" group is created as a child of system and then i pass the "recommendations" actorRef to each instance of "frontActor" through the constructor.
I don't know if what I finally did is the best in terms of Akka approach but it seems to have much more sense to me and a better use of akka groups pools that my previous approach. Akka looks amazing a very interesting framework to study and use. Again, thanks a lot for your help! I really appreciate it. El domingo, 10 de abril de 2016, 17:44:15 (UTC-3), √ escribió: > I'm sorry for not being more clear in my response. > > I mean that when you say: > > /recommendations > > in the config, you're saying that the actor named "recommendations" is a > child of the user root actor, i.e. once created using actorsystem.actorOf > > But in your code, it is created within another actor, and as the error > message says, that actor is named "$a" and that means "/a$/recommendations" > doesn't have a deployment section. > > The fix is to give your actor, now named $a (because you didn't provide a > name parameter to actorOf) a real, stable, name, and chance > /recommendations to /parentsofthatname/thatname/recommendations > > > On Sun, Apr 10, 2016 at 10:33 PM, Federico Jakimowicz <[email protected] > <javascript:>> wrote: > >> sorry for being such a dumb but i dont follow you >> >> El domingo, 10 de abril de 2016, 16:36:02 (UTC-3), √ escribió: >>> >>> Deployment paths are absolute and your instances do not live directly >>> below your root. (As witnessed by $a in your path) >>> >>> -- >>> Cheers, >>> √ >>> On Apr 10, 2016 21:16, "Federico Jakimowicz" <[email protected]> wrote: >>> >>>> Hi! >>>> >>>> I'm having a very hard time with akka configuration, I have read quite >>>> a lot, still it seems i fail to understand the proper way to configure >>>> akka >>>> many times. >>>> lets suppose i have an actor that wants to send messages to remote >>>> actors, to make it fail proof i want to have groups so i can have the same >>>> acto deployed in several apps, right now is only one of each kind >>>> >>>> So far this is my configuration: >>>> >>>> akka { >>>> loglevel = INFO >>>> actor { >>>> provider = "akka.remote.RemoteActorRefProvider" >>>> deployment { >>>> /recommendations { >>>> router = round-robin-group >>>> routees.paths = [ >>>> "akka.tcp:// >>>> [email protected]:2553/user/RecommendationsActor", >>>> ] >>>> } >>>> /trends { >>>> router = round-robin-group >>>> routees.paths = [ >>>> "akka.tcp://[email protected]:2554/user/TrendsActor", >>>> ] >>>> } >>>> /front { >>>> router = round-robin-pool >>>> nr-of-instances = 5 >>>> } >>>> >>>> } >>>> } >>>> remote { >>>> enabled-transports = ["akka.remote.netty.tcp"] >>>> netty.tcp { >>>> hostname = "127.0.0.1" >>>> port = 2551 >>>> } >>>> } >>>> } >>>> >>>> >>>> the problem is that when i want to get a reference to trends or >>>> recommendations from actor front >>>> to do something like this: >>>> >>>> public void onReceive(Object message) throws Exception { >>>> System.out.println(message); >>>> ActorRef recommendations = >>>> getContext().actorOf(FromConfig.getInstance().props(), "recommendations"); >>>> ActorRef trend = >>>> getContext().actorOf(FromConfig.getInstance().props(), "trends"); >>>> recommendations.tell(message, self()); >>>> trend.tell(message, self()); >>>> } >>>> >>>> it fails with: >>>> >>>> Caused by: akka.ConfigurationException: Configuration missing for >>>> router [akka://front/user/front/$a/recommendations] in >>>> 'akka.actor.deployment' section. >>>> >>>> >>>> I dont get why it tries to get recommendations in the path >>>> /front/$a/recommendations I guess it must be something regarding >>>> supervision? >>>> Which would be the proper way to configure or retrieve this? >>>> >>>> thanks in advance >>>> >>>> >>>> >>>> >>>> -- >>>> >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>> >>>>>>>>>> Check the FAQ: >>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>> >>>>>>>>>> Search the archives: >>>> https://groups.google.com/group/akka-user >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "Akka User List" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at https://groups.google.com/group/akka-user. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> -- >> >>>>>>>>>> Read the docs: http://akka.io/docs/ >> >>>>>>>>>> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user >> --- >> You received this message because you are subscribed to the Google Groups >> "Akka User List" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at https://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Cheers, > √ > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
