Create TurbineClustersProvider

Extract separate class TurbineClustersProvider to be able to provide custom solution for retrieving configured clusters (#2219)
This commit is contained in:
Nastya Smirnova
2017-10-21 04:46:29 +03:00
committed by Spencer Gibb
parent 28de82e63c
commit ffc431753b
11 changed files with 361 additions and 28 deletions

View File

@@ -688,6 +688,9 @@ turbine:
appConfig: customers
----
If you need to customize which cluster names should be used by Turbine (you don't want to store cluster names in
`turbine.aggregator.clusterConfig` configuration) provide a bean of type `TurbineClustersProvider`.
The `clusterName` can be customized by a SPEL expression in `turbine.clusterNameExpression` with root an instance of `InstanceInfo`. The default value is `appName`, which means that the Eureka serviceId ends up as the cluster key (i.e. the `InstanceInfo` for customers has an `appName` of "CUSTOMERS"). A different example would be `turbine.clusterNameExpression=aSGName`, which would get the cluster name from the AWS ASG name. Another example:
----