Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Member Roles doc #5742

Merged
merged 23 commits into from
Mar 24, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion docs/articles/clustering/member-roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ else if (selfMember.HasRole("front"))

### Akka.Cluster.Sharding
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to make all headers consistent - either code formatted or regular text, not a blend of both


Specifies that entities runs on cluster nodes with a specific role. If the role is not specified (or empty) all nodes in the cluster are used.

```hocon
akka {
cluster {
Expand All @@ -51,8 +53,20 @@ akka {
}
```

```csharp
var sharding = ClusterSharding.Get(system);
var shardRegion = await sharding.StartAsync(
typeName: "customer",
entityPropsFactory: e => Props.Create(() => new Customer(e)),
settings: ClusterShardingSettings.Create(system).WithRole("worker"),
messageExtractor: new MessageExtractor(10));

```

### `DistributedPubSub`

Start the mediator on members tagged with this role. All members are used if undefined or empty.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mediator will send messages to all nodes tagged with this role, otherwise all members will receive Mediator gossip.


```hocon
akka {
cluster {
Expand All @@ -66,6 +80,8 @@ akka {

### `DData`

Replicas are running on members tagged with this role. All members are used if undefined or empty

```hocon
akka {
cluster {
Expand All @@ -77,9 +93,10 @@ akka {
}
```


### `ClusterSingleton`

Singleton among the nodes tagged with specified role. If the role is not specified it's a singleton among all nodes in the cluster.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifies which nodes might host a specific singleton - if the role is not specified than any node can, in theory, host a singleton.


```hocon
akka {
cluster {
Expand Down