That fix my problem, very useful, thanks so much. One suggestion, Could you add this part to routers with remote section<http://doc.akka.io/docs/akka/2.3.0/java/remoting.html>? here just some config snippets, makes people confused.
在 2012年4月15日星期日UTC+8下午10时49分44秒,rkuhn写道: > > Hi Liu, > > a router must be declared in the code in order to enable that > functionality, see > http://doc.akka.io/docs/akka/2.0.1/scala/routing.html#How_Routing_is_Designed_within_Akka > > So, in order to fix this, add .withRouter(FromConfig.getInstance()) to > your Props (or “new FromConfig()”, which is the only way in 2.0). > > Regards, > > Roland > > On Apr 10, 2012, at 03:18 , Liu Js wrote: > > I make sure it's not remote, because I debug the code, the ActorRef's type > is LocalActorRef. > I make sure the configuration has been loaded, because some configuration > have worked, such as the port. > > I think some of my config is wrong, but I copy the config from akka's doc. > > Can you give me some advice? > > On Monday, April 9, 2012 7:17:52 PM UTC+8, √ wrote: >> >> >> >> On Mon, Apr 9, 2012 at 11:33 AM, Liu Js <[email protected] >> <javascript:>>wrote: >> >>> I want to deploy a remote actor with a router, >>> *this is my config:* >>> pingSys { >>> akka { >>> actor { >>> provider = "akka.remote.RemoteActorRefProvider" >>> >>> deployment { >>> /myPongActor { >>> router = "round-robin" >>> nr-of-instances = 5 >>> target { >>> nodes = ["akka://[email protected]:5555", "akka:// >>> [email protected]:6666"] >>> } >>> } >>> } >>> } >>> remote { >>> transport = "akka.remote.netty.NettyRemoteTransport" >>> netty { >>> hostname = "127.0.0.1" >>> port = 4444 >>> } >>> } >>> } >>> } >>> >>> *This is my code:* >>> final ActorSystem pingSys = ActorSystem.create("pingSystem", >>> ConfigFactory.load().getConfig("pingSys")); >>> >>> ActorRef ping = pingSys.actorOf(new Props(PingActor.class), >>> "myPingActor"); >>> ActorRef pong = pingSys.actorOf(new Props(PongActor.class), >>> "myPongActor"); >>> ping.tell("run", pong); >>> >>> *However, the myPongActor is created locally.* >>> >>> *This is the output log:* >>> [INFO] [04/09/2012 17:33:05.560] [main] [ActorSystem(pingSystem)] >>> REMOTE: RemoteServerStarted@akka://[email protected]:4444 >>> akka://pingSystem/user/myPingActor say ping >>> akka://pingSystem/user/myPongActor say pong >>> akka://pingSystem/user/myPingActor say ping >>> >>> *What's the reason?* >>> >>> >> How do you know that it's not remote? Have you've enabled debug logging? >> Have youv'e made sure that the correct config gets loaded? >> >> Cheers, >> √ >> >> >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Akka User List" group. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msg/akka-user/-/ko4RaJ5Nh2YJ. >>> To post to this group, send email to [email protected]<javascript:> >>> . >>> To unsubscribe from this group, send email to >>> [email protected] <javascript:>. >>> For more options, visit this group at >>> http://groups.google.com/group/akka-user?hl=en. >>> >> >> > -- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/akka-user/-/72Wq5D55rccJ. > To post to this group, send email to [email protected]<javascript:> > . > To unsubscribe from this group, send email to > [email protected] <javascript:>. > For more options, visit this group at > http://groups.google.com/group/akka-user?hl=en. > > > Roland Kuhn > Typesafe <http://typesafe.com/> – The software stack for applications > that scale. > twitter: @rolandkuhn <http://twitter.com/#!/rolandkuhn> > > -- >>>>>>>>>> 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 http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
