1

I have 2 project (sbt), say projectA and projectB. projectA dependsOn projectB. How do i configure akka cluster such that both the projects passes messages using actors? Both projectA and projectB forms a cluster with seed -nodes.

nocturnal
  • 395
  • 2
  • 6
  • 15

1 Answers1

1

If you want to send a message to a specific actor you can look up remote actors via actorSelection:

val selection context.actorSelection("akka.tcp://actorSystemName@10.0.0.1:2552/user/actorName")

Lots of details in the docs here: https://doc.akka.io/docs/akka/2.5/remoting.html

Of you can make use of a feature like ClusterSharding or ClusterSingleton where you don't need to create the actors, just send messages and Akka will create them for you.

  • Those configuration setting are mandatory : akka { actor { provider = remote } remote { enabled-transports = ["akka.remote.netty.tcp"] netty.tcp { hostname = "127.0.0.1" port = 2552 } } } – Alex Stanovsky Jul 02 '18 at 19:33