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
bab74edf
Commit
bab74edf
authored
Jun 23, 2015
by
Spencer Gibb
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #340 from kaczynskid/master
Corrected example of providing Turbine cluster name via instance metadata map
parents
652e4b96
8fa9b715
Show 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 @
bab74edf
...
@@ -477,7 +477,7 @@ turbine:
...
@@ -477,7 +477,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 @
bab74edf
...
@@ -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