=clu #15412 Add paths(system) method to Group router
to be able to use the role correctly in cluster aware routers This solution is very similar to what we did for nrOfInstances in Pool routers.
This commit is contained in:
parent
6420a37250
commit
a94f7cdc98
16 changed files with 188 additions and 15 deletions
|
|
@ -128,7 +128,14 @@ private[akka] trait ClusterRouterSettingsBase {
|
|||
@SerialVersionUID(1L)
|
||||
final case class ClusterRouterGroup(local: Group, settings: ClusterRouterGroupSettings) extends Group with ClusterRouterConfigBase {
|
||||
|
||||
override def paths: immutable.Iterable[String] = if (settings.allowLocalRoutees) settings.routeesPaths else Nil
|
||||
override def paths(system: ActorSystem): immutable.Iterable[String] =
|
||||
if (settings.allowLocalRoutees && settings.useRole.isDefined) {
|
||||
if (Cluster(system).selfRoles.contains(settings.useRole.get)) {
|
||||
settings.routeesPaths
|
||||
} else Nil
|
||||
} else if (settings.allowLocalRoutees && settings.useRole.isEmpty) {
|
||||
settings.routeesPaths
|
||||
} else Nil
|
||||
|
||||
/**
|
||||
* INTERNAL API
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue