diff --git a/docs/pom.xml b/docs/pom.xml index cd9be789..61b79152 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -19,7 +19,14 @@ spring-cloud-config ${basedir}/.. deploy - + spring.cloud.config.* + + + + ${project.groupId} + spring-cloud-starter-config + + src/main/asciidoc @@ -33,23 +40,20 @@ git-commit-id-plugin - org.codehaus.mojo - exec-maven-plugin - - - org.apache.maven.plugins maven-dependency-plugin - org.apache.maven.plugins maven-resources-plugin + + org.codehaus.mojo + exec-maven-plugin + org.asciidoctor asciidoctor-maven-plugin - org.apache.maven.plugins maven-antrun-plugin diff --git a/docs/src/main/asciidoc/_configprops.adoc b/docs/src/main/asciidoc/_configprops.adoc new file mode 100644 index 00000000..595be92b --- /dev/null +++ b/docs/src/main/asciidoc/_configprops.adoc @@ -0,0 +1,27 @@ +|=== +|Name | Default | Description + +|spring.cloud.config.allow-override | true | Flag to indicate that {@link #isOverrideSystemProperties() systemPropertiesOverride} can be used. Set to false to prevent users from changing the default accidentally. Default true. +|spring.cloud.config.discovery.enabled | false | Flag to indicate that config server discovery is enabled (config server URL will be looked up via discovery). +|spring.cloud.config.discovery.service-id | configserver | Service id to locate config server. +|spring.cloud.config.enabled | true | Flag to say that remote configuration is enabled. Default true; +|spring.cloud.config.fail-fast | false | Flag to indicate that failure to connect to the server is fatal (default false). +|spring.cloud.config.headers | | Additional headers used to create the client request. +|spring.cloud.config.label | | The label name to use to pull remote configuration properties. The default is set on the server (generally "master" for a git based server). +|spring.cloud.config.name | | Name of application used to fetch remote properties. +|spring.cloud.config.override-none | false | Flag to indicate that when {@link #setAllowOverride(boolean) allowOverride} is true, external properties should take lowest priority and should not override any existing property sources (including local config files). Default false. +|spring.cloud.config.override-system-properties | true | Flag to indicate that the external properties should override system properties. Default true. +|spring.cloud.config.password | | The password to use (HTTP Basic) when contacting the remote server. +|spring.cloud.config.profile | default | The default profile to use when fetching remote configuration (comma-separated). Default is "default". +|spring.cloud.config.request-connect-timeout | 0 | timeout on waiting to connect to the Config Server. +|spring.cloud.config.request-read-timeout | 0 | timeout on waiting to read data from the Config Server. +|spring.cloud.config.retry.initial-interval | 1000 | Initial retry interval in milliseconds. +|spring.cloud.config.retry.max-attempts | 6 | Maximum number of attempts. +|spring.cloud.config.retry.max-interval | 2000 | Maximum interval for backoff. +|spring.cloud.config.retry.multiplier | 1.1 | Multiplier for next interval. +|spring.cloud.config.send-state | true | Flag to indicate whether to send state. Default true. +|spring.cloud.config.token | | Security Token passed thru to underlying environment repository. +|spring.cloud.config.uri | [http://localhost:8888] | The URI of the remote server (default http://localhost:8888). +|spring.cloud.config.username | | The username to use (HTTP Basic) when contacting the remote server. + +|=== \ No newline at end of file diff --git a/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/DiscoveryClientConfigServiceBootstrapConfiguration.java b/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/DiscoveryClientConfigServiceBootstrapConfiguration.java index 4d3815ed..01638336 100644 --- a/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/DiscoveryClientConfigServiceBootstrapConfiguration.java +++ b/spring-cloud-config-client/src/main/java/org/springframework/cloud/config/client/DiscoveryClientConfigServiceBootstrapConfiguration.java @@ -23,7 +23,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.ObjectProvider; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.cloud.client.ServiceInstance; import org.springframework.cloud.client.discovery.DiscoveryClient; @@ -71,20 +70,24 @@ public class DiscoveryClientConfigServiceBootstrapConfiguration { } @Bean - public SmartApplicationListener heartbeatListener( + public SmartApplicationListener heartbeatListener(ConfigClientProperties properties, ConfigServerInstanceProvider provider) { - return new HeartbeatListener(); + return new HeartbeatListener(properties, provider); } - private static class HeartbeatListener implements SmartApplicationListener { + private final static class HeartbeatListener implements SmartApplicationListener { - @Autowired - private ConfigClientProperties config; + private final ConfigClientProperties config; - @Autowired - private ConfigServerInstanceProvider instanceProvider; + private final ConfigServerInstanceProvider instanceProvider; - private HeartbeatMonitor monitor = new HeartbeatMonitor(); + private final HeartbeatMonitor monitor = new HeartbeatMonitor(); + + private HeartbeatListener(ConfigClientProperties config, + ConfigServerInstanceProvider instanceProvider) { + this.config = config; + this.instanceProvider = instanceProvider; + } @Override public boolean supportsEventType(Class eventType) {