Well, i solved this creating two different files for each system and 
loading each conf from the specific file.



El domingo, 27 de marzo de 2016, 11:41:47 (UTC-3), Federico Jakimowicz 
escribió:

> Hi!
>
> I'm giving my firsts steps with Akka, I'm mainly a Java developer and i 
> have been quite interested in this framework.
> The issue I'm facing is the following:
>
> I have one very simple app as server :
>
> public class BackendApp {
>
>  private static ActorSystem backend;
>  
>  public static void main(String[] args) {
>   Config config = ConfigFactory.load();
>   backend = ActorSystem.create("backend", 
> config.getConfig("backend").withFallback(ConfigFactory.load()));
>   backend.actorOf(Props.create(Simple.class), "simple");
>  }
>
> }
>
> where Simple Actor is
>
> public class Simple extends UntypedActor {
>  
>  public Simple(){
>  }
>
>  @Override
>  public void onReceive(Object message) {
>   System.out.println(message);
>   System.out.println(this.getSender());
>   if(message.equals("terminate")){
>    System.out.println("Backend App terminating");
>    this.getContext().system().terminate();
>   }else{
>    unhandled(message);
>   }
>  }
> }
>
>
>
> and a client:
>
> public class ClientApp {
>
>  private static ActorSystem frontEnd;
>
>  public static void main(String[] args) {
>   Config config = ConfigFactory.load(); 
>   frontEnd = ActorSystem.create("client", 
> config.getConfig("client").withFallback(ConfigFactory.load()));
>   String path = "akka.tcp://[email protected]:2551/user/simple";
>   ActorSelection simple = frontEnd.actorSelection(path);
>   simple.tell("Hello", ActorRef.noSender());
>   simple.tell("terminate", ActorRef.noSender());
>   System.out.println("Client App terminating");
>   frontEnd.terminate();
>  }
>
> }
>
> and the config file application.conf is this:
>
> backend {
>  actor {
>   provider = "akka.remote.RemoteActorRefProvider"
>  }
>  remote {
>    enabled-transports = ["akka.remote.netty.tcp"]
>    netty.tcp {
>        hostname = "127.0.0.1" 
>        port = 2551
>       }
>  }
> }
>
>
> client {
>  actor {
>   provider = "akka.remote.RemoteActorRefProvider"
>  }
>  remote {
>    enabled-transports = ["akka.remote.netty.tcp"]
>    netty.tcp {
>        hostname = "127.0.0.1"
>        port = 2552
>       }
>  }
> }
>
>
> that's all.
>
> The problem is that the client actor selection seems to be looking for the 
> remote actor in the "client" system ignoring the remote reference.
> And I have also seen that: 
> backend.provider() is akka.actor.LocalActorRefProvider
> and not the configured remote one in the conf file.
>
> When the client wants to send a message to the backend this is the error 
> message displayed:
> [client-akka.actor.default-dispatcher-2] [akka://client/deadLetters] 
> Message [java.lang.String] from Actor[akka://client/deadLetters] to 
> Actor[akka://client/deadLetters] was not delivered. [1] dead letters 
> encountered.
>
> So I would say no remoting configuration is being considered at all.
> I have been reading the documentation but it seems I'm missing something.
>
> I am running this apps from eclipse by just right clicking on each of 
> the  main class files and running them as applications, no extra params 
> supplied.
>
> Could someone enlight me a bit please?
>
> thanks a lot.
>
> Fede
>
>
>
>
>
>
>
>

-- 
>>>>>>>>>>      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.

Reply via email to