Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-cloud-netflix
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
spring-cloud-netflix
Commits
8fa9b715
Commit
8fa9b715
authored
May 07, 2015
by
Darek Kaczyński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrected example of providing Turbine cluster name via instance metadata map.
parent
532cfd9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
spring-cloud-netflix.adoc
docs/src/main/asciidoc/spring-cloud-netflix.adoc
+1
-1
EurekaInstanceDiscoveryTest.java
...rk/cloud/netflix/turbine/EurekaInstanceDiscoveryTest.java
+12
-0
No files found.
docs/src/main/asciidoc/spring-cloud-netflix.adoc
View file @
8fa9b715
...
@@ -517,7 +517,7 @@ turbine:
...
@@ -517,7 +517,7 @@ turbine:
aggregator:
aggregator:
clusterConfig: SYSTEM,USER
clusterConfig: SYSTEM,USER
appConfig: customers,stores,ui,admin
appConfig: customers,stores,ui,admin
clusterNameExpression: metadata
.cluster
clusterNameExpression: metadata
['cluster']
----
----
In this case, the cluster name from 4 services is pulled from their metadata map, and is expected to have values that include "SYSTEM" and "USER".
In this case, the cluster name from 4 services is pulled from their metadata map, and is expected to have values that include "SYSTEM" and "USER".
...
...
spring-cloud-netflix-turbine/src/test/java/org/springframework/cloud/netflix/turbine/EurekaInstanceDiscoveryTest.java
View file @
8fa9b715
...
@@ -50,4 +50,16 @@ public class EurekaInstanceDiscoveryTest {
...
@@ -50,4 +50,16 @@ public class EurekaInstanceDiscoveryTest {
assertEquals
(
"clusterName is wrong"
,
asgName
,
clusterName
);
assertEquals
(
"clusterName is wrong"
,
asgName
,
clusterName
);
}
}
@Test
public
void
testGetClusterNameInstanceMetadataMapExpression
()
{
TurbineProperties
turbineProperties
=
new
TurbineProperties
();
turbineProperties
.
setClusterNameExpression
(
"metadata['cluster']"
);
EurekaInstanceDiscovery
discovery
=
new
EurekaInstanceDiscovery
(
turbineProperties
);
String
metadataProperty
=
"myCluster"
;
InstanceInfo
instanceInfo
=
InstanceInfo
.
Builder
.
newBuilder
()
.
setAppName
(
"testApp"
).
add
(
"cluster"
,
metadataProperty
).
build
();
String
clusterName
=
discovery
.
getClusterName
(
instanceInfo
);
assertEquals
(
"clusterName is wrong"
,
metadataProperty
,
clusterName
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment