How to start Actor in separate JVM on same machine?

179 views
Skip to first unread message

Harit Himanshu

unread,
Jun 16, 2015, 5:49:47 PM6/16/15
to akka...@googlegroups.com
Hello there!

Here is the current situation. I have a ActorSystem which has multiple actors - Monitoring, Scheduling, Processing. It starts all of them in single JVM.  

During one of the design reviews, I was told that Processing may consume lot of memory and may throw OutOfMemoryException, which may bring down the entire JVM (hence ActorSystem).

This sounds like a design constraint where the entire system becomes fragile and not fault tolerant. 

I thought and drew the diagram about what I would like to do 




Questions
  1. How  can I start ProcessingActor in a separate JVM on a single machine?
  2. If we extend the same idea, we should be able to start actors on separate JVM and different machines, right?

Please provide your valuable inputs.

Thank you
+ Harit 

Patrik Nordwall

unread,
Jun 18, 2015, 2:03:40 AM6/18/15
to akka...@googlegroups.com
It is possible to start an actor in another remote ActorSystem, by using the remote deployment feature. See this section of the documentation: http://doc.akka.io/docs/akka/2.3.11/java/remoting.html#Creating_Actors_Remotely

You must still start the JVM and the ActorSystem separately.

An alternative is that you simply start the ProcessingActor when you start that ActorSystem, and then lookup that actor from the other system, see http://doc.akka.io/docs/akka/2.3.11/java/remoting.html#Looking_up_Remote_Actors

Both these approaches are also illustrated in the remoting sample.

A third alternative is that you use Akka Cluster and run the Processing on nodes (JVMs) with a special role.

Cheers,
Patrik

PS. There is Scala versions of the above links, if you use Scala.

--
>>>>>>>>>> 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+...@googlegroups.com.
To post to this group, send email to akka...@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 Reactive apps on the JVM
Twitter: @patriknw

Reply all
Reply to author
Forward
0 new messages