From a5f41a1ce0b5e4b1af0c677acb6d5695653e0f50 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 5 Jun 2018 18:57:20 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- multi/multi_spring-cloud-consul-config.html | 2 +- multi/multi_spring-cloud-consul-discovery.html | 2 +- multi/multi_spring-cloud-consul.html | 2 +- single/spring-cloud-consul.html | 6 +++--- spring-cloud-consul.xml | 12 ++++++++++-- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/multi/multi_spring-cloud-consul-config.html b/multi/multi_spring-cloud-consul-config.html index ee143324..fcfb3050 100644 --- a/multi/multi_spring-cloud-consul-config.html +++ b/multi/multi_spring-cloud-consul-config.html @@ -12,7 +12,7 @@ config/application/

The most specific property source is at the top, wit prefix: configuration defaultContext: apps profileSeparator: '::'

-

4.3 Config Watch

The Consul Config Watch takes advantage of the ability of consul to watch a key prefix. The Config Watch makes a blocking Consul HTTP API call to determine if any relevant configuration data has changed for the current application. If there is new configuration data a Refresh Event is published. This is equivalent to calling the /refresh actuator endpoint.

To change the frequency of when the Config Watch is called change spring.cloud.consul.config.watch.delay. The default value is 1000, which is in milliseconds.

To disable the Config Watch set spring.cloud.consul.config.watch.enabled=false.

4.4 YAML or Properties with Config

It may be more convenient to store a blob of properties in YAML or Properties format as opposed to individual key/value pairs. Set the spring.cloud.consul.config.format property to YAML or PROPERTIES. For example to use YAML:

bootstrap.yml.  +

  • enabled setting this value to "false" disables Consul Config
  • prefix sets the base folder for configuration values
  • defaultContext sets the folder name used by all applications
  • profileSeparator sets the value of the separator used to separate the profile name in property sources with profiles

4.3 Config Watch

The Consul Config Watch takes advantage of the ability of consul to watch a key prefix. The Config Watch makes a blocking Consul HTTP API call to determine if any relevant configuration data has changed for the current application. If there is new configuration data a Refresh Event is published. This is equivalent to calling the /refresh actuator endpoint.

To change the frequency of when the Config Watch is called change spring.cloud.consul.config.watch.delay. The default value is 1000, which is in milliseconds. The delay is the amount of time after the end of the previous invocation and the start of the next.

To disable the Config Watch set spring.cloud.consul.config.watch.enabled=false.

The watch uses a Spring TaskScheduler to schedule the call to consul. By default it is a ThreadPoolTaskScheduler with a poolSize of 1. To change the TaskScheduler, create a bean of type TaskScheduler named with the ConsulConfigAutoConfiguration.CONFIG_WATCH_TASK_SCHEDULER_NAME constant.

4.4 YAML or Properties with Config

It may be more convenient to store a blob of properties in YAML or Properties format as opposed to individual key/value pairs. Set the spring.cloud.consul.config.format property to YAML or PROPERTIES. For example to use YAML:

bootstrap.yml. 

spring:
   cloud:
     consul:
diff --git a/multi/multi_spring-cloud-consul-discovery.html b/multi/multi_spring-cloud-consul-discovery.html
index a2761e46..80ce3f54 100644
--- a/multi/multi_spring-cloud-consul-discovery.html
+++ b/multi/multi_spring-cloud-consul-discovery.html
@@ -59,4 +59,4 @@ public String serviceUrl() {
         return list.get(0).getUri();
     }
     return null;
-}
\ No newline at end of file +}

3.5 Consul Catalog Watch

The Consul Catalog Watch takes advantage of the ability of consul to watch services. The Catalog Watch makes a blocking Consul HTTP API call to determine if any services have changed. If there is new service data a Heartbeat Event is published.

To change the frequency of when the Config Watch is called change spring.cloud.consul.config.discovery.catalog-services-watch-delay. The default value is 1000, which is in milliseconds. The delay is the amount of time after the end of the previous invocation and the start of the next.

To disable the Catalog Watch set spring.cloud.consul.discovery.catalog-services-watch.enabled=false.

The watch uses a Spring TaskScheduler to schedule the call to consul. By default it is a ThreadPoolTaskScheduler with a poolSize of 1. To change the TaskScheduler, create a bean of type TaskScheduler named with the ConsulDiscoveryClientConfiguration.CATALOG_WATCH_TASK_SCHEDULER_NAME constant.

\ No newline at end of file diff --git a/multi/multi_spring-cloud-consul.html b/multi/multi_spring-cloud-consul.html index 89684001..8f1f199b 100644 --- a/multi/multi_spring-cloud-consul.html +++ b/multi/multi_spring-cloud-consul.html @@ -1,3 +1,3 @@ - Spring Cloud Consul

Spring Cloud Consul


\ No newline at end of file + Spring Cloud Consul

Spring Cloud Consul


\ No newline at end of file diff --git a/single/spring-cloud-consul.html b/single/spring-cloud-consul.html index 5078c733..34d33b43 100644 --- a/single/spring-cloud-consul.html +++ b/single/spring-cloud-consul.html @@ -1,6 +1,6 @@ - Spring Cloud Consul

Spring Cloud Consul


2.0.0.BUILD-SNAPSHOT

This project provides Consul integrations for Spring Boot apps through autoconfiguration + Spring Cloud Consul

Spring Cloud Consul


2.0.0.BUILD-SNAPSHOT

This project provides Consul integrations for Spring Boot apps through autoconfiguration and binding to the Spring Environment and other Spring programming model idioms. With a few simple annotations you can quickly enable and configure the common patterns inside your application and build large distributed systems with Consul based components. The @@ -65,7 +65,7 @@ public String serviceUrl() { return list.get(0).getUri(); } return null; -}

4. Distributed Configuration with Consul

Consul provides a Key/Value Store for storing configuration and other metadata. Spring Cloud Consul Config is an alternative to the Config Server and Client. Configuration is loaded into the Spring Environment during the special "bootstrap" phase. Configuration is stored in the /config folder by default. Multiple PropertySource instances are created based on the application’s name and the active profiles that mimicks the Spring Cloud Config order of resolving properties. For example, an application with the name "testApp" and with the "dev" profile will have the following property sources created:

config/testApp,dev/
+}

3.5 Consul Catalog Watch

The Consul Catalog Watch takes advantage of the ability of consul to watch services. The Catalog Watch makes a blocking Consul HTTP API call to determine if any services have changed. If there is new service data a Heartbeat Event is published.

To change the frequency of when the Config Watch is called change spring.cloud.consul.config.discovery.catalog-services-watch-delay. The default value is 1000, which is in milliseconds. The delay is the amount of time after the end of the previous invocation and the start of the next.

To disable the Catalog Watch set spring.cloud.consul.discovery.catalog-services-watch.enabled=false.

The watch uses a Spring TaskScheduler to schedule the call to consul. By default it is a ThreadPoolTaskScheduler with a poolSize of 1. To change the TaskScheduler, create a bean of type TaskScheduler named with the ConsulDiscoveryClientConfiguration.CATALOG_WATCH_TASK_SCHEDULER_NAME constant.

4. Distributed Configuration with Consul

Consul provides a Key/Value Store for storing configuration and other metadata. Spring Cloud Consul Config is an alternative to the Config Server and Client. Configuration is loaded into the Spring Environment during the special "bootstrap" phase. Configuration is stored in the /config folder by default. Multiple PropertySource instances are created based on the application’s name and the active profiles that mimicks the Spring Cloud Config order of resolving properties. For example, an application with the name "testApp" and with the "dev" profile will have the following property sources created:

config/testApp,dev/
 config/testApp/
 config/application,dev/
 config/application/

The most specific property source is at the top, with the least specific at the bottom. Properties in the config/application folder are applicable to all applications using consul for configuration. Properties in the config/testApp folder are only available to the instances of the service named "testApp".

Configuration is currently read on startup of the application. Sending a HTTP POST to /refresh will cause the configuration to be reloaded. Section 4.3, “Config Watch” will also automatically detect changes and reload the application context.

4.1 How to activate

To get started with Consul Configuration use the starter with group org.springframework.cloud and artifact id spring-cloud-starter-consul-config. See the Spring Cloud Project page for details on setting up your build system with the current Spring Cloud Release Train.

This will enable auto-configuration that will setup Spring Cloud Consul Config.

4.2 Customizing

Consul Config may be customized using the following properties:

bootstrap.yml.  @@ -77,7 +77,7 @@ config/application/

The most specific property source is at the top, wit prefix: configuration defaultContext: apps profileSeparator: '::'

-

  • enabled setting this value to "false" disables Consul Config
  • prefix sets the base folder for configuration values
  • defaultContext sets the folder name used by all applications
  • profileSeparator sets the value of the separator used to separate the profile name in property sources with profiles

4.3 Config Watch

The Consul Config Watch takes advantage of the ability of consul to watch a key prefix. The Config Watch makes a blocking Consul HTTP API call to determine if any relevant configuration data has changed for the current application. If there is new configuration data a Refresh Event is published. This is equivalent to calling the /refresh actuator endpoint.

To change the frequency of when the Config Watch is called change spring.cloud.consul.config.watch.delay. The default value is 1000, which is in milliseconds.

To disable the Config Watch set spring.cloud.consul.config.watch.enabled=false.

4.4 YAML or Properties with Config

It may be more convenient to store a blob of properties in YAML or Properties format as opposed to individual key/value pairs. Set the spring.cloud.consul.config.format property to YAML or PROPERTIES. For example to use YAML:

bootstrap.yml.  +

  • enabled setting this value to "false" disables Consul Config
  • prefix sets the base folder for configuration values
  • defaultContext sets the folder name used by all applications
  • profileSeparator sets the value of the separator used to separate the profile name in property sources with profiles

4.3 Config Watch

The Consul Config Watch takes advantage of the ability of consul to watch a key prefix. The Config Watch makes a blocking Consul HTTP API call to determine if any relevant configuration data has changed for the current application. If there is new configuration data a Refresh Event is published. This is equivalent to calling the /refresh actuator endpoint.

To change the frequency of when the Config Watch is called change spring.cloud.consul.config.watch.delay. The default value is 1000, which is in milliseconds. The delay is the amount of time after the end of the previous invocation and the start of the next.

To disable the Config Watch set spring.cloud.consul.config.watch.enabled=false.

The watch uses a Spring TaskScheduler to schedule the call to consul. By default it is a ThreadPoolTaskScheduler with a poolSize of 1. To change the TaskScheduler, create a bean of type TaskScheduler named with the ConsulConfigAutoConfiguration.CONFIG_WATCH_TASK_SCHEDULER_NAME constant.

4.4 YAML or Properties with Config

It may be more convenient to store a blob of properties in YAML or Properties format as opposed to individual key/value pairs. Set the spring.cloud.consul.config.format property to YAML or PROPERTIES. For example to use YAML:

bootstrap.yml. 

spring:
   cloud:
     consul:
diff --git a/spring-cloud-consul.xml b/spring-cloud-consul.xml
index c69fb01e..37be9447 100644
--- a/spring-cloud-consul.xml
+++ b/spring-cloud-consul.xml
@@ -4,7 +4,7 @@
 
 
 Spring Cloud Consul
-2018-05-29
+2018-06-05
 
 
 
@@ -153,6 +153,13 @@ public String serviceUrl() {
 }
 
 
+
+Consul Catalog Watch +The Consul Catalog Watch takes advantage of the ability of consul to watch services. The Catalog Watch makes a blocking Consul HTTP API call to determine if any services have changed. If there is new service data a Heartbeat Event is published. +To change the frequency of when the Config Watch is called change spring.cloud.consul.config.discovery.catalog-services-watch-delay. The default value is 1000, which is in milliseconds. The delay is the amount of time after the end of the previous invocation and the start of the next. +To disable the Catalog Watch set spring.cloud.consul.discovery.catalog-services-watch.enabled=false. +The watch uses a Spring TaskScheduler to schedule the call to consul. By default it is a ThreadPoolTaskScheduler with a poolSize of 1. To change the TaskScheduler, create a bean of type TaskScheduler named with the ConsulDiscoveryClientConfiguration.CATALOG_WATCH_TASK_SCHEDULER_NAME constant. +
Distributed Configuration with Consul @@ -202,8 +209,9 @@ config/application/
Config Watch The Consul Config Watch takes advantage of the ability of consul to watch a key prefix. The Config Watch makes a blocking Consul HTTP API call to determine if any relevant configuration data has changed for the current application. If there is new configuration data a Refresh Event is published. This is equivalent to calling the /refresh actuator endpoint. -To change the frequency of when the Config Watch is called change spring.cloud.consul.config.watch.delay. The default value is 1000, which is in milliseconds. +To change the frequency of when the Config Watch is called change spring.cloud.consul.config.watch.delay. The default value is 1000, which is in milliseconds. The delay is the amount of time after the end of the previous invocation and the start of the next. To disable the Config Watch set spring.cloud.consul.config.watch.enabled=false. +The watch uses a Spring TaskScheduler to schedule the call to consul. By default it is a ThreadPoolTaskScheduler with a poolSize of 1. To change the TaskScheduler, create a bean of type TaskScheduler named with the ConsulConfigAutoConfiguration.CONFIG_WATCH_TASK_SCHEDULER_NAME constant.
YAML or Properties with Config