Sync docs from master to gh-pages
This commit is contained in:
@@ -1,21 +1,13 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>5. Embedding the Config Server</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-config.html" title="Spring Cloud Config"><link rel="up" href="multi_spring-cloud-config.html" title="Spring Cloud Config"><link rel="prev" href="multi__serving_plain_text.html" title="4. Serving Plain Text"><link rel="next" href="multi__push_notifications_and_spring_cloud_bus.html" title="6. Push Notifications and Spring Cloud Bus"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5. Embedding the Config Server</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__serving_plain_text.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__push_notifications_and_spring_cloud_bus.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_embedding_the_config_server" href="#_embedding_the_config_server"></a>5. Embedding the Config Server</h1></div></div></div><p>The Config Server runs best as a standalone application, but if you
|
||||
need to you can embed it in another application. Just use the
|
||||
<code class="literal">@EnableConfigServer</code> annotation. An optional property that can be
|
||||
useful in this case is <code class="literal">spring.cloud.config.server.bootstrap</code> which is
|
||||
a flag to indicate that the server should configure itself from its
|
||||
own remote repository. The flag is off by default because it can delay
|
||||
startup, but when embedded in another application it makes sense to
|
||||
initialize the same way as any other application.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>It should be obvious, but remember that if you use the bootstrap
|
||||
flag the config server will need to have its name and repository URI
|
||||
configured in <code class="literal">bootstrap.yml</code>.</p></td></tr></table></div><p>To change the location of the server endpoints you can (optionally)
|
||||
set <code class="literal">spring.cloud.config.server.prefix</code>, e.g. "/config", to serve the
|
||||
resources under a prefix. The prefix should start but not end with a
|
||||
"/". It is applied to the <code class="literal">@RequestMappings</code> in the Config Server
|
||||
(i.e. underneath the Spring Boot prefixes <code class="literal">server.servletPath</code> and
|
||||
<code class="literal">server.contextPath</code>).</p><p>If you want to read the configuration for an application directly from
|
||||
the backend repository (instead of from the config server) that’s
|
||||
basically an embedded config server with no endpoints. You can switch
|
||||
off the endpoints entirely if you don’t use the <code class="literal">@EnableConfigServer</code>
|
||||
annotation (just set <code class="literal">spring.cloud.config.server.bootstrap=true</code>).</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__serving_plain_text.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi__push_notifications_and_spring_cloud_bus.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">4. Serving Plain Text </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-config.html">Home</a></td><td width="40%" align="right" valign="top"> 6. Push Notifications and Spring Cloud Bus</td></tr></table></div></body></html>
|
||||
<title>5. Embedding the Config Server</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="multi_spring-cloud-config.html" title="Spring Cloud Config"><link rel="up" href="multi_spring-cloud-config.html" title="Spring Cloud Config"><link rel="prev" href="multi__serving_plain_text.html" title="4. Serving Plain Text"><link rel="next" href="multi__push_notifications_and_spring_cloud_bus.html" title="6. Push Notifications and Spring Cloud Bus"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5. Embedding the Config Server</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__serving_plain_text.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__push_notifications_and_spring_cloud_bus.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_embedding_the_config_server" href="#_embedding_the_config_server"></a>5. Embedding the Config Server</h1></div></div></div><p>The Config Server runs best as a standalone application.
|
||||
However, if need be, you can embed it in another application.
|
||||
To do so, use the <code class="literal">@EnableConfigServer</code> annotation.
|
||||
An optional property named <code class="literal">spring.cloud.config.server.bootstrap</code> can be useful in this case is.
|
||||
It is a flag to indicate whether the server should configure itself from its own remote repository.
|
||||
By default, the flag is off, because it can delay startup.
|
||||
However, when embedded in another application, it makes sense to initialize the same way as any other application.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>If you use the bootstrap flag, the config server needs to have its name and repository URI configured in <code class="literal">bootstrap.yml</code>.</p></td></tr></table></div><p>To change the location of the server endpoints, you can (optionally) set <code class="literal">spring.cloud.config.server.prefix</code> (for example, <code class="literal">/config</code>), to serve the resources under a prefix.
|
||||
The prefix should start but not end with a <code class="literal">/</code>.
|
||||
It is applied to the <code class="literal">@RequestMappings</code> in the Config Server (that is, underneath the Spring Boot <code class="literal">server.servletPath</code> and <code class="literal">server.contextPath</code> prefixes).</p><p>If you want to read the configuration for an application directly from the backend repository (instead of from the config server), you
|
||||
basically wat an embedded config server with no endpoints.
|
||||
You can switch off the endpoints entirely by not using the <code class="literal">@EnableConfigServer</code> annotation (set <code class="literal">spring.cloud.config.server.bootstrap=true</code>).</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__serving_plain_text.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi__push_notifications_and_spring_cloud_bus.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">4. Serving Plain Text </td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud-config.html">Home</a></td><td width="40%" align="right" valign="top"> 6. Push Notifications and Spring Cloud Bus</td></tr></table></div></body></html>
|
||||
Reference in New Issue
Block a user