user1187135
user1187135

Reputation:

Do you run a separate Actor System on each host in a distributed system using Akka Cluster?

Here's my assumption based on Stackoverflow reading.

You have a multiple system components:

  1. Database
  2. Authentication
  3. Web

Each system component runs on a separate host as described in the microservice pattern. In other to glue these host together you need to:

Here are my questions:

  1. Can you not run an Actor system on each host and still link to the cluster?
  2. How do you direct messages based on role? Say I want to direct a database message to the database component from the web component?

Upvotes: 4

Views: 128

Answers (1)

user1187135
user1187135

Reputation:

Figure out the answer after some studying.

1) Yes, you need to run a separate actor system if it is physically on another system. This is so that you can join the seed nodes. Otherwise, when the actor dies, there is not actor system to restart it.

2) Roles are not used to direct messages. It is simply used to indicate to the other nodes in the cluster that a node with this tag has joined the cluster.

In order to send messages to different nodes, you need to use Custer Routers

Upvotes: 1

Related Questions