The path of the actor in the config must match the path of the actor in the 
actor system, i.e. /connectorActor instead of /connectorActor/processingActor.

Heiko

--

Heiko Seeberger
Home: heikoseeberger.de <http://heikoseeberger.de/>
Twitter: @hseeberger <https://twitter.com/hseeberger>
Public key: keybase.io/hseeberger <https://keybase.io/hseeberger>
> On 23 Jul 2015, at 22:28, Harit Himanshu <harit.subscripti...@gmail.com> 
> wrote:
> 
> I am trying to deploy actor remotely on different JVM.
> 
> **ProcessingMain** (start on JVM1)
> 
>     object ProcessingMain {
> 
>       def main(args: Array[String]) = {
>         startProcessingSystem()
>       }
> 
>       def startProcessingSystem() = {
>         ActorSystem.create("ProcessingSystem", 
> ConfigFactory.load("processingSystem"))
>         println("ProcessingSystem Started")
>       }
>     }
> 
> **ConnectorMain**(start on JVM2)
> 
>     object ConnectorMain {
> 
>       def main(args: Array[String]) = {
>         startConnectorSystem()
>       }
> 
>       def startConnectorSystem() = {
>         val system = ActorSystem.create("ConnectorSystem", 
> ConfigFactory.load("connectorSystem"))
>         val actor = system.actorOf(Props[ConnectorActor], "connectorActor")
>         println("ConnectorSystem Started")
>         actor ! StartRemoteProcessor
>       }
>     }
> 
> **common.conf**
> 
>     akka {
>       actor {
>         provider = "akka.remote.RemoteActorRefProvider"
>       }
> 
>       remote {
>         netty.tcp {
>           hostname = "127.0.0.1"
>         }
>       }
>     }
> 
> **processingSystem.conf**
> 
>     include "common"
> 
>     akka {
>       # LISTEN on tcp port 2552
>       remote.netty.tcp.port = 2552
>     }
> 
> **connectorSystem.conf**
> 
>     include "common"
> 
>     akka {
>       actor {
>         deployment {
>           /connectorActor/processingActor {
>             remote = "akka.tcp://ProcessingSystem@127.0.0.1:2552"
>           }
>         }
>       }
>       remote.netty.tcp.port = 2554
>     }
> 
> **ConnnectorActor**
> 
>     import akka.actor._
>     import com.learn.remote.processing.ProcessingActor
> 
>     case object StartRemoteProcessor
> 
>     class ConnectorActor extends Actor with ActorLogging {
>       val remoteProcessor = context.actorOf(Props[ProcessingActor], 
> "processingActor")
> 
>       def receive = {
>         case StartRemoteProcessor =>
>           println("Starting Remote Processor")
>           remoteProcessor ! "Start"
>       }
>     }
> 
> When I run **ProcessingMain**, I see
> 
>     ProcessingSystem Started
> 
> When I run **ConnectorMain**, I see
> 
>     ConnectorSystem Started
>     Starting Remote Processor
>     ProcessingActor 
> path:akka://ConnectorSystem/user/connectorActor/processingActor
> 
> As you see, instead of starting `processingActor` on `ProcessingSystem` it is 
> started on `ConnectorSystem`
> 
> What's wrong going on?
> 
> 
> 
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/ <http://akka.io/docs/>
> >>>>>>>>>> Check the FAQ: 
> >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html 
> >>>>>>>>>> <http://doc.akka.io/docs/akka/current/additional/faq.html>
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user 
> >>>>>>>>>> <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 
> <mailto:akka-user+unsubscr...@googlegroups.com>.
> To post to this group, send email to akka-user@googlegroups.com 
> <mailto:akka-user@googlegroups.com>.
> Visit this group at http://groups.google.com/group/akka-user 
> <http://groups.google.com/group/akka-user>.
> For more options, visit https://groups.google.com/d/optout 
> <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 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.

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

Reply via email to