Sync docs from 2.1.x to gh-pages
This commit is contained in:
@@ -17,7 +17,7 @@ The following listing shows an example:</p><p><b>bootstrap.yml. </b>
|
||||
uri: ${SPRING_CONFIG_URI:http://localhost:8888}</pre><p>
|
||||
</p><p>If your application needs any application-specific configuration from the server, it is a good idea to set the <code class="literal">spring.application.name</code> (in <code class="literal">bootstrap.yml</code> or <code class="literal">application.yml</code>).
|
||||
In order for the property <code class="literal">spring.application.name</code> to be used as the application’s context ID you
|
||||
must set it in <code class="literal">bootstrap.[properties | yml]</code>.</p><p>You can disable the bootstrap process completely by setting <code class="literal">spring.cloud.bootstrap.enabled=false</code> (for example, in system properties).</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_application_context_hierarchies" href="#_application_context_hierarchies"></a>1.2 Application Context Hierarchies</h2></div></div></div><p>If you build an application context from <code class="literal">SpringApplication</code> or <code class="literal">SpringApplicationBuilder</code>, then the Bootstrap context is added as a parent to that context.
|
||||
must set it in <code class="literal">bootstrap.[properties | yml]</code>.</p><p>If you want to retrieve specific profile configuration, you should also set <code class="literal">spring.profiles.active</code> in <code class="literal">bootstrap.[properties | yml]</code>.</p><p>You can disable the bootstrap process completely by setting <code class="literal">spring.cloud.bootstrap.enabled=false</code> (for example, in system properties).</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="_application_context_hierarchies" href="#_application_context_hierarchies"></a>1.2 Application Context Hierarchies</h2></div></div></div><p>If you build an application context from <code class="literal">SpringApplication</code> or <code class="literal">SpringApplicationBuilder</code>, then the Bootstrap context is added as a parent to that context.
|
||||
It is a feature of Spring that child contexts inherit property sources and profiles from their parent, so the <span class="quote">“<span class="quote">main</span>”</span> application context contains additional property sources, compared to building the same context without Spring Cloud Config.
|
||||
The additional property sources are:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><span class="quote">“<span class="quote">bootstrap</span>”</span>: If any <code class="literal">PropertySourceLocators</code> are found in the Bootstrap context and if they have non-empty properties, an optional <code class="literal">CompositePropertySource</code> appears with high priority.
|
||||
An example would be properties from the Spring Cloud Config Server.
|
||||
|
||||
Reference in New Issue
Block a user