简体   繁体   中英

how to send message from non actor to akka actor in java

i am new to Akka. i want to send message to an actor from a simple java class. i have path to actor, can anyone tell me that how can i get context to the actor. this is what i am trying now.

ActorRef actroRef = 
    Akka.system.actorSelection(CmsAdminActor.NAME + appID).resolveOne();
actroRef.tell("any  message", noSender());

i have imported these files:

import akka.actor.ActorSystem;
import akka.actor.Props;
import akka.actor.ActorRef;

my project is maven and i am using inteliJ as IDE. akka related things are ok to access in other actors and all other packages are also accessible but in this java class "Akka" in line "Akka.system.actorSelection(...)" inteliJ is saying that "Akka" symbol is not resolved.

so please give me some solution to this and if anyone have done this thing "sending message from no actor to actor" with some best solution please give that one also.

thanks.

play.libs.Akka is a play helper class, Akka.system() is the helper method to access the standard ActorSystem created with play. You won't have that if you are not working with the play framework.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM