From 923eafc9e4e3f5bd771e6137b8bb9d16a6616320 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Fri, 24 Jul 2015 08:46:09 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- spring-cloud.html | 45 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/spring-cloud.html b/spring-cloud.html index e2918bf..21caad0 100644 --- a/spring-cloud.html +++ b/spring-cloud.html @@ -753,8 +753,8 @@ things with their parent.

Changing the Location of Bootstrap Properties

-

The bootstrap.yml (or .properties) location can be specified using -spring.cloud.bootstrap.name (default "bootstrap") or +

The bootstrap.yml (or .properties) location can be specified using +`spring.cloud.bootstrap.name (default "bootstrap") or spring.cloud.bootstrap.location (default empty), e.g. in System properties. Those properties behave like the spring.config.* variants with the same name, in fact they are used to set up the @@ -1236,7 +1236,7 @@ high-priority property source, e.g.

$ curl localhost:8080/env
 {
   "profiles":[],
-  "configService:https://github.com/scratches/config-repo/bar.properties":{"foo":"bar"},
+  "configService:https://github.com/spring-cloud-samples/config-repo/bar.properties":{"foo":"bar"},
   "servletContextInitParams":{},
   "systemProperties":{...},
   ...
@@ -1248,6 +1248,19 @@ high-priority property source, e.g.

repository>/<file name>" contains the property "foo" with value "bar" and is highest priority).

+
+ + + + + +
+
Note
+
+the URL in the property source name is the git repository not +the config server URL. +
+
@@ -1876,7 +1889,7 @@ an Exception.

Locating Remote Configuration Resources

-

The Config Service serves property sources from /{name}/{env}/{label}, where the default bindings in the client app are

+

The Config Service serves property sources from /{name}/{profile}/{label}, where the default bindings in the client app are

    @@ -1884,7 +1897,7 @@ an Exception.

    "name" = ${spring.application.name}

  • -

    "env" = ${spring.profiles.active} (actually Environment.getActiveProfiles())

    +

    "profile" = ${spring.profiles.active} (actually Environment.getActiveProfiles())

  • "label" = "master"

    @@ -1893,7 +1906,7 @@ an Exception.

All of them can be overridden by setting spring.cloud.config.* -(where * is "name", "env" or "label"). The "label" is useful for +(where * is "name", "profile" or "label"). The "label" is useful for rolling back to previous versions of configuration; with the default Config Server implementation it can be a git label, branch name or commit id. Label can also be provided as a comma-separated list, in @@ -2102,6 +2115,24 @@ application, so it’s helpful if they are accurate.

+

Using Eureka on AWS

+
+

If the application is planned to be deployed to an AWS cloud, then the Eureka instance will have to be configured to be Amazon aware and this can be done by customizing the EurekaInstanceConfigBean the following way:

+
+
+
+
@Bean
+@Profile("!default")
+public EurekaInstanceConfigBean eurekaInstanceConfig() {
+  EurekaInstanceConfigBean b = new EurekaInstanceConfigBean();
+  AmazonInfo info = AmazonInfo.Builder.newBuilder().autoBuild("eureka");
+  b.setDataCenterInfo(info);
+  return b;
+}
+
+
+
+

Making the Eureka Instance ID Unique

By default a eureka instance is registered with an ID that is equal to its host name (i.e. only one service per host). Using Spring Cloud you can override this by providing a unique identifier in eureka.instance.metadataMap.instanceId. For example:

@@ -3470,7 +3501,7 @@ AQAjPgt3eFZQXwt8tsHAVv/QHiY5sI2dRcR+...