On 05/18/15 14:09, Mark Joslin wrote:
Hi guys, I was hoping you could point me in the right direction. I have an API server with the Play framework that uses actors. Right now, these are just local actors but their workload is growing and since I'm beginning to introduce more & more scheduled background jobs, I would like it to be its own stand-alone job server.

I believe the difficulty lies in differentiating who is the API server and who is the job server and how that relates to actor creation / selection. Naturally, I just want the API server(s) to target the actor systems on the job server(s). Does anyone have any experience with this kind of job? My original thought was just to use environment variables and say "Ok, I'm an API server, don't spin up this actor system" OR "Ok, I'm a job server, join this actor system cluster". I tried looking around for some resources, but didn't find anything and was hoping you guys could help me out.

it seems like this would fit well with cluster sharding (http://doc.akka.io/docs/akka/2.3.11/scala/cluster-usage.html#Cluster_Sharding) and persistence (http://doc.akka.io/docs/akka/2.3.11/scala/persistence.html). your jobs could be cluster shard entities. on the API side, you can use sharding proxy-only mode to route the requests from the API server to the job server.

alternatively, with some extra plumbing, you can use regular akka cluster and give each node in the cluster a role (http://doc.akka.io/docs/akka/2.3.11/scala/cluster-usage.html#Node_Roles). On the API side, you can listen for cluster membership events, and maintain a router that routes requests to the current job servers.

of the two, the first choice would be the easier one.

-Michael

--
     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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to