Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Akka remoting and Heroku

Tags:

heroku

scala

akka

I'm investigating the use of Scala/Play/Akka on Heroku and I'm curious about something. Suppose I have an application structured as a network of Akka actors. Some of the actors will be in-process with the web application itself, but I may want to set aside one or more nodes as dedicated Akka actors: for example, a group of cache manager actors.

To configure Akka remoting, I need to supply IP addresses in akka.conf. But since Heroku nodes are somewhat ephemeral, I won't know each node's address at the time I write the config file.

It might simplify things to have a central "registration" node, but even there, I won't know the IP address of that node in advance.

So how do my Akka nodes refer to each other on Heroku?

like image 703
Bill Avatar asked Apr 05 '12 00:04

Bill


1 Answers

Heroku dynos can't talk directly to each other so you will have to use an external messaging system like RabbitMQ. There is a great article on the Heroku Dev Center about how to coordinate Akka Actors in this way:
https://devcenter.heroku.com/articles/scaling-out-with-scala-and-akka

like image 80
James Ward Avatar answered Oct 30 '22 05:10

James Ward