You have not enabled remoting with configururation

akka.actor.provider = "akka.remote.RemoteActorRefProvider"


Cheers,

Patrik

On Tue, Aug 4, 2015 at 12:42 AM, <fb...@cs.stonybrook.edu> wrote:

> Hi all,
>
> I am new to Akka, I have successfully written a simple Akka application
> that runs on single machine. Now I want to distribute my application to
> multiple nodes available on my standalone cluster. Here is my code. Now if
> you see the "addr1", it has a port = -1, which should be illegal and not
> work. In addition to that there is no node in the cluster with hostname =
> "host". But still if I compile and run this code, it shows me the message
> delivered "Remote Test Message". What am I missing here?
>
>
> public class AkkaIO
> {
>     public AkkaIO(){
>     // create a system
>     ActorSystem system = ActorSystem.create("DistributedIOSystem");
>
>     Address addr1 = new Address("akka.tcp", "DistributedIOSystem-blaa",
> "host", -1);
>
>     ActorRef master = system.actorOf(Props.create(IOMaster.class).
> withDeploy(new Deploy(new RemoteScope(addr1))));
>     master.tell(new IOBegin(), master);
>     }
>
> }
>
> class IOMaster extends UntypedActor
> {
>     private final ActorRef workerRouter;
>
>     public IOMaster(){
>
>     Address addr2 = new Address("akka.tcp", "DistributedIOSystem-blaa",
> "host", 9999);
>
>     Address[] addresses = new Address[] {addr2};
>     workerRouter = this.getContext().
>         actorOf(IOWorker.
>             createWorker().
>             withRouter(new RemoteRouterConfig(new RoundRobinRouter(2),
> addresses)));
>     }
>
>     public void onReceive(Object message){
>     if (message instanceof IOBegin){
>         workerRouter.tell(new Test(), getSelf());
>     }
>     }
> }
>
> class IOWorker extends UntypedActor
> {
>     public void onReceive(Object message){
>     if (message instanceof Test){
>         System.out.println("Remote Test Message");
>     }
>     else
>         unhandled(message);
>     }
>     public static Props createWorker(){
>     return Props.create(IOWorker.class, new ArraySeq<Object>(0));
>     }
> }
>
> class Test{}
> class IOBegin{}
>
>
>
>
>
> --
> >>>>>>>>>> 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 akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to