Hello there,

I have been learning Akka and as part of my project I wanted to run the 
test for my usecase, I need help with it

Github link <https://github.com/hhimanshu/akka-remote-deployment> for my 
code sample

*Scenario*

   1. I have 2 Actor Systems - ProcessingSystem and ConnectorSystem.
   2. ProcessingSystem runs on port 2552 and ConnectorSystem on port 2554
   3. ProcessingSystem starts first and then ConnectorSystem
   4. ConnectorSystem starts a remote actor on ProcessingSystem and sends 
   message
   5. ConnectorSystem has a supervision strategy
   6. This is all configured using configuration files


*Place I am stuck?*

   1. I looked at the sample 
   <http://letitcrash.com/post/35341473217/2-1-spotlight-multi-node-testing> 
   provided, but I am not sure how to use my ActorSystems with this test. How 
   can I provide *ConnectorMain* and *ProcessingMain* as is to my test. In 
   sample the actors are created as part of test which usually is different 
   because your source is somewhere else.
   2. I am not sure how configurations will be provided or if I need to 
   provide them


Can some one please guide me?

*ConnectorActor*
package com.learn.connector import akka.actor.SupervisorStrategy.Restart
import akka.actor._import akka.event.LoggingReceiveimport 
com.learn.remote.processing.ProcessingActor import 
scala.concurrent.duration._ case object StartRemoteProcessor class 
ConnectorActor extends Actor with ActorLogging { val remoteProcessor = 
context.actorOf(Props[ProcessingActor], "processingActor")  override def 
supervisorStrategy = OneForOneStrategy(maxNrOfRetries = 3, withinTimeRange = 
20 seconds) { case e: Exception => log.error("Exception received => " + 
e.getMessage) Restart } def receive = LoggingReceive { case 
StartRemoteProcessor => log.info("Starting Remote Processor") 
remoteProcessor ! "Start" case Terminated(`remoteProcessor`) => 
log.error("remoteProcessor 
seems to be died") }}
*ProcessingActor*
package com.learn.remote.processing import akka.actor.{Actor, ActorLogging}
import akka.event.LoggingReceive class ProcessingActor extends Actor with 
ActorLogging { def receive = LoggingReceive { case "Start" => 
log.info("ProcessingActor 
path => " + self.path) throw new IllegalArgumentException("Some Error") }}
*ConnectorMain*
package com.learn.main import akka.actor.{ActorSystem, Props}import 
com.learn.connector.{ConnectorActor, StartRemoteProcessor}import 
com.typesafe.config.ConfigFactory 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 }}

*ProcessingMain*
package com.learn.main import akka.actor.ActorSystemimport 
com.typesafe.config.ConfigFactory object ProcessingMain { def main(args: 
Array[String]) = { startProcessingSystem() } def startProcessingSystem() = { 
ActorSystem.create("ProcessingSystem", ConfigFactory.load("processingSystem"
)) println("ProcessingSystem Started") }}

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