Sync docs from master to gh-pages
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<html><head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>6. Push Notifications and Spring Cloud Bus</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__embedding_the_config_server.html" title="5. Embedding the Config Server"><link rel="next" href="multi__spring_cloud_config_client.html" title="7. Spring Cloud Config Client"></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">6. Push Notifications and Spring Cloud Bus</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__embedding_the_config_server.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__spring_cloud_config_client.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_push_notifications_and_spring_cloud_bus" href="#_push_notifications_and_spring_cloud_bus"></a>6. Push Notifications and Spring Cloud Bus</h1></div></div></div><p>Many source code repository providers (such as Github, Gitlab, Gitee, or Bitbucket) notify you of changes in a repository through a webhook.
|
||||
<title>6. Push Notifications and Spring Cloud Bus</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__embedding_the_config_server.html" title="5. Embedding the Config Server"><link rel="next" href="multi__spring_cloud_config_client.html" title="7. Spring Cloud Config Client"></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">6. Push Notifications and Spring Cloud Bus</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__embedding_the_config_server.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="multi__spring_cloud_config_client.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_push_notifications_and_spring_cloud_bus" href="#_push_notifications_and_spring_cloud_bus"></a>6. Push Notifications and Spring Cloud Bus</h1></div></div></div><p>Many source code repository providers (such as Github, Gitlab, Gitea, Gitee, Gogs, or Bitbucket) notify you of changes in a repository through a webhook.
|
||||
You can configure the webhook through the provider’s user interface as a URL and a set of events in which you are interested.
|
||||
For instance, <a class="link" href="https://developer.github.com/v3/activity/events/types/#pushevent" target="_top">Github</a> uses a POST to the webhook with a JSON body containing a list of commits and a header (<code class="literal">X-Github-Event</code>) set to <code class="literal">push</code>.
|
||||
If you add a dependency on the <code class="literal">spring-cloud-config-monitor</code> library and activate the Spring Cloud Bus in your Config Server, then a <code class="literal">/monitor</code> endpoint is enabled.</p><p>When the webhook is activated, the Config Server sends a <code class="literal">RefreshRemoteApplicationEvent</code> targeted at the applications it thinks might have changed.
|
||||
The change detection can be strategized.
|
||||
However, by default, it looks for changes in files that match the application name (for example, <code class="literal">foo.properties</code> is targeted at the <code class="literal">foo</code> application, while <code class="literal">application.properties</code> is targeted at all applications).
|
||||
The strategy to use when you want to override the behavior is <code class="literal">PropertyPathNotificationExtractor</code>, which accepts the request headers and body as parameters and returns a list of file paths that changed.</p><p>The default configuration works out of the box with Github, Gitlab, Gitee, or Bitbucket.
|
||||
The strategy to use when you want to override the behavior is <code class="literal">PropertyPathNotificationExtractor</code>, which accepts the request headers and body as parameters and returns a list of file paths that changed.</p><p>The default configuration works out of the box with Github, Gitlab, Gitea, Gitee, Gogs or Bitbucket.
|
||||
In addition to the JSON notifications from Github, Gitlab, Gitee, or Bitbucket, you can trigger a change notification by POSTing to <code class="literal">/monitor</code> with form-encoded body parameters in the pattern of <code class="literal">path={name}</code>.
|
||||
Doing so broadcasts to applications matching the <code class="literal">{name}</code> pattern (which can contain wildcards).</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>The <code class="literal">RefreshRemoteApplicationEvent</code> is transmitted only if the <code class="literal">spring-cloud-bus</code> is activated in both the Config Server and in the client application.</p></td></tr></table></div><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>The default configuration also detects filesystem changes in local git repositories. In that case, the webhook is not used. However, as soon as you edit a config file, a refresh is broadcast.</p></td></tr></table></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__embedding_the_config_server.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="multi__spring_cloud_config_client.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5. Embedding the Config Server </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"> 7. Spring Cloud Config Client</td></tr></table></div></body></html>
|
||||
@@ -552,13 +552,13 @@ However, when embedded in another application, it makes sense to initialize the
|
||||
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="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_push_notifications_and_spring_cloud_bus" href="#_push_notifications_and_spring_cloud_bus"></a>6. Push Notifications and Spring Cloud Bus</h1></div></div></div><p>Many source code repository providers (such as Github, Gitlab, Gitee, or Bitbucket) notify you of changes in a repository through a webhook.
|
||||
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="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_push_notifications_and_spring_cloud_bus" href="#_push_notifications_and_spring_cloud_bus"></a>6. Push Notifications and Spring Cloud Bus</h1></div></div></div><p>Many source code repository providers (such as Github, Gitlab, Gitea, Gitee, Gogs, or Bitbucket) notify you of changes in a repository through a webhook.
|
||||
You can configure the webhook through the provider’s user interface as a URL and a set of events in which you are interested.
|
||||
For instance, <a class="link" href="https://developer.github.com/v3/activity/events/types/#pushevent" target="_top">Github</a> uses a POST to the webhook with a JSON body containing a list of commits and a header (<code class="literal">X-Github-Event</code>) set to <code class="literal">push</code>.
|
||||
If you add a dependency on the <code class="literal">spring-cloud-config-monitor</code> library and activate the Spring Cloud Bus in your Config Server, then a <code class="literal">/monitor</code> endpoint is enabled.</p><p>When the webhook is activated, the Config Server sends a <code class="literal">RefreshRemoteApplicationEvent</code> targeted at the applications it thinks might have changed.
|
||||
The change detection can be strategized.
|
||||
However, by default, it looks for changes in files that match the application name (for example, <code class="literal">foo.properties</code> is targeted at the <code class="literal">foo</code> application, while <code class="literal">application.properties</code> is targeted at all applications).
|
||||
The strategy to use when you want to override the behavior is <code class="literal">PropertyPathNotificationExtractor</code>, which accepts the request headers and body as parameters and returns a list of file paths that changed.</p><p>The default configuration works out of the box with Github, Gitlab, Gitee, or Bitbucket.
|
||||
The strategy to use when you want to override the behavior is <code class="literal">PropertyPathNotificationExtractor</code>, which accepts the request headers and body as parameters and returns a list of file paths that changed.</p><p>The default configuration works out of the box with Github, Gitlab, Gitea, Gitee, Gogs or Bitbucket.
|
||||
In addition to the JSON notifications from Github, Gitlab, Gitee, or Bitbucket, you can trigger a change notification by POSTing to <code class="literal">/monitor</code> with form-encoded body parameters in the pattern of <code class="literal">path={name}</code>.
|
||||
Doing so broadcasts to applications matching the <code class="literal">{name}</code> pattern (which can contain wildcards).</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>The <code class="literal">RefreshRemoteApplicationEvent</code> is transmitted only if the <code class="literal">spring-cloud-bus</code> is activated in both the Config Server and in the client application.</p></td></tr></table></div><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>The default configuration also detects filesystem changes in local git repositories. In that case, the webhook is not used. However, as soon as you edit a config file, a refresh is broadcast.</p></td></tr></table></div></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="_spring_cloud_config_client" href="#_spring_cloud_config_client"></a>7. Spring Cloud Config Client</h1></div></div></div><p>A Spring Boot application can take immediate advantage of the Spring Config Server (or other external property sources provided by the application developer).
|
||||
It also picks up some additional useful features related to <code class="literal">Environment</code> change events.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="config-first-bootstrap" href="#config-first-bootstrap"></a>7.1 Config First Bootstrap</h2></div></div></div><p>The default behavior for any application that has the Spring Cloud Config Client on the classpath is as follows:
|
||||
|
||||
@@ -1149,7 +1149,7 @@ You can switch off the endpoints entirely by not using the <literal>@EnableConfi
|
||||
</chapter>
|
||||
<chapter xml:id="_push_notifications_and_spring_cloud_bus">
|
||||
<title>Push Notifications and Spring Cloud Bus</title>
|
||||
<simpara>Many source code repository providers (such as Github, Gitlab, Gitee, or Bitbucket) notify you of changes in a repository through a webhook.
|
||||
<simpara>Many source code repository providers (such as Github, Gitlab, Gitea, Gitee, Gogs, or Bitbucket) notify you of changes in a repository through a webhook.
|
||||
You can configure the webhook through the provider’s user interface as a URL and a set of events in which you are interested.
|
||||
For instance, <link xl:href="https://developer.github.com/v3/activity/events/types/#pushevent">Github</link> uses a POST to the webhook with a JSON body containing a list of commits and a header (<literal>X-Github-Event</literal>) set to <literal>push</literal>.
|
||||
If you add a dependency on the <literal>spring-cloud-config-monitor</literal> library and activate the Spring Cloud Bus in your Config Server, then a <literal>/monitor</literal> endpoint is enabled.</simpara>
|
||||
@@ -1157,7 +1157,7 @@ If you add a dependency on the <literal>spring-cloud-config-monitor</literal> li
|
||||
The change detection can be strategized.
|
||||
However, by default, it looks for changes in files that match the application name (for example, <literal>foo.properties</literal> is targeted at the <literal>foo</literal> application, while <literal>application.properties</literal> is targeted at all applications).
|
||||
The strategy to use when you want to override the behavior is <literal>PropertyPathNotificationExtractor</literal>, which accepts the request headers and body as parameters and returns a list of file paths that changed.</simpara>
|
||||
<simpara>The default configuration works out of the box with Github, Gitlab, Gitee, or Bitbucket.
|
||||
<simpara>The default configuration works out of the box with Github, Gitlab, Gitea, Gitee, Gogs or Bitbucket.
|
||||
In addition to the JSON notifications from Github, Gitlab, Gitee, or Bitbucket, you can trigger a change notification by POSTing to <literal>/monitor</literal> with form-encoded body parameters in the pattern of <literal>path={name}</literal>.
|
||||
Doing so broadcasts to applications matching the <literal>{name}</literal> pattern (which can contain wildcards).</simpara>
|
||||
<note>
|
||||
|
||||
Reference in New Issue
Block a user