Routing message from Cluster to Cluster

As per my understanding,

Cluster-Client is used to communicate message between two clusters

ClusterClient.Send will deliver message to one recipient with a matching path, if any such exists. If several entries match the path the message will be delivered to one random destination.

Instead of delivering randomly is it possible to route the message by using akka routing concept

Hi @anilkumble

For Cluster to Cluster communication, I don’t recommend using cluster client (or any remoting from outside the cluster) any more because it has several drawbacks:

  • it’s less stable than having all nodes in the same cluster and you can more easily get into situations where nodes have to be restarted because of quarantining when messages are lost (e.g. because of intermittent network problems)
  • it introduces tight coupling between the external actor system and the cluster because you need to make sure that you run exactly the same versions of akka / your application, so that serialization is compatible between all parts of your system

My recommendation is to use either Akka gRPC or Akka HTTP to interface with a cluster. Both encourage specifying well-defined interfaces that are easier to keep compatible between versions. And also, both, gRPC and HTTP, allow streaming use cases.

Thanks @hungai. I will refer Akka gPRC and Akka HTTP

What is the use of Cluster Client Akka cluster