I am trying to create Akka Actors on a remote host. Following the official documentation, I create a remote Actor System parsing the application.config file and then I create a new actor. This is my code:
public static void main(String[] args) {
Config config = ConfigFactory.parseFile(new File("application.conf"));
ActorSystem system = ActorSystem.create("system",config);
ActorRef actor = system.actorOf(Props.create(SampleActor.class), "sampleActor");
System.out.println(actor.path());
actor.tell("Hello", ActorRef.noSender());
}
And this is how I set up the application.conf file:
akka { actor { provider = remote } remote { enabled-transports = ["akka.remote.netty.tcp"] netty.tcp { hostname = "shielded-atoll-29637.herokuapp.com" port = 2552 } } }
Further details:
- Akka protocol is provided by default by Akka
- shielded-atoll-29637.herokuapp.com is the default domain of my server hosted on heroku.
The point is: should I take another server or heroku is sufficient? In case Heroku is okay, am I supposed to write a server application that is listening on the port 2552 for incoming actor-creating requests? Because the documentation does not mention anything at all.
Thanks in advance, Giacomo