This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Cloud Consul 4.1.3!spring-doc.cn

Common application properties

Various properties can be specified inside your application.properties file, inside your application.yml file, or as command line switches. This appendix provides a list of common Spring Cloud Consul properties and references to the underlying classes that consume them.spring-doc.cn

Property contributions can come from additional jar files on your classpath, so you should not consider this an exhaustive list. Also, you can define your own properties.
Name Default Description

spring.cloud.consul.config.acl-tokenspring-doc.cn

spring.cloud.consul.config.data-keyspring-doc.cn

dataspring-doc.cn

If format is Format.PROPERTIES or Format.YAML then the following field is used as key to look up consul for configuration.spring-doc.cn

spring.cloud.consul.config.default-contextspring-doc.cn

applicationspring-doc.cn

spring.cloud.consul.config.enabledspring-doc.cn

truespring-doc.cn

spring.cloud.consul.config.fail-fastspring-doc.cn

truespring-doc.cn

Throw exceptions during config lookup if true, otherwise, log warnings.spring-doc.cn

spring.cloud.consul.config.formatspring-doc.cn

spring.cloud.consul.config.namespring-doc.cn

Alternative to spring.application.name to use in looking up values in consul KV.spring-doc.cn

spring.cloud.consul.config.prefixspring-doc.cn

spring.cloud.consul.config.prefixesspring-doc.cn

spring.cloud.consul.config.profile-separatorspring-doc.cn

,spring-doc.cn

spring.cloud.consul.config.watch.delayspring-doc.cn

1000spring-doc.cn

The value of the fixed delay for the watch in millis. Defaults to 1000.spring-doc.cn

spring.cloud.consul.config.watch.enabledspring-doc.cn

truespring-doc.cn

If the watch is enabled. Defaults to true.spring-doc.cn

spring.cloud.consul.config.watch.wait-timespring-doc.cn

55spring-doc.cn

The number of seconds to wait (or block) for watch query, defaults to 55. Needs to be less than default ConsulClient (defaults to 60). To increase ConsulClient timeout create a ConsulClient bean with a custom ConsulRawClient with a custom HttpClient.spring-doc.cn

spring.cloud.consul.discovery.acl-tokenspring-doc.cn

spring.cloud.consul.discovery.catalog-services-watch-delayspring-doc.cn

1000spring-doc.cn

The delay between calls to watch consul catalog in millis, default is 1000.spring-doc.cn

spring.cloud.consul.discovery.catalog-services-watch-timeoutspring-doc.cn

2spring-doc.cn

The number of seconds to block while watching consul catalog, default is 2.spring-doc.cn

spring.cloud.consul.discovery.consistency-modespring-doc.cn

Consistency mode for health service request.spring-doc.cn

spring.cloud.consul.discovery.datacentersspring-doc.cn

Map of serviceId’s → datacenter to query for in server list. This allows looking up services in another datacenters.spring-doc.cn

spring.cloud.consul.discovery.default-query-tagspring-doc.cn

Tag to query for in service list if one is not listed in serverListQueryTags. Multiple tags can be specified with a comma separated value.spring-doc.cn

spring.cloud.consul.discovery.default-zone-metadata-namespring-doc.cn

zonespring-doc.cn

Service instance zone comes from metadata. This allows changing the metadata tag name.spring-doc.cn

spring.cloud.consul.discovery.deregisterspring-doc.cn

truespring-doc.cn

Disable automatic de-registration of service in consul.spring-doc.cn

spring.cloud.consul.discovery.enable-tag-overridespring-doc.cn

Enable tag override for the registered service.spring-doc.cn

spring.cloud.consul.discovery.enabledspring-doc.cn

truespring-doc.cn

Is service discovery enabled?spring-doc.cn

spring.cloud.consul.discovery.fail-fastspring-doc.cn

truespring-doc.cn

Throw exceptions during service registration if true, otherwise, log warnings (defaults to true).spring-doc.cn

spring.cloud.consul.discovery.health-check-critical-timeoutspring-doc.cn

Timeout to deregister services critical for longer than timeout (e.g. 30m). Requires consul version 7.x or higher.spring-doc.cn

spring.cloud.consul.discovery.health-check-headersspring-doc.cn

Headers to be applied to the Health Check calls.spring-doc.cn

spring.cloud.consul.discovery.health-check-intervalspring-doc.cn

10sspring-doc.cn

How often to perform the health check (e.g. 10s), defaults to 10s.spring-doc.cn

spring.cloud.consul.discovery.health-check-pathspring-doc.cn

/actuator/healthspring-doc.cn

Alternate server path to invoke for health checking.spring-doc.cn

spring.cloud.consul.discovery.health-check-timeoutspring-doc.cn

Timeout for health check (e.g. 10s).spring-doc.cn

spring.cloud.consul.discovery.health-check-tls-skip-verifyspring-doc.cn

Skips certificate verification during service checks if true, otherwise runs certificate verification.spring-doc.cn

spring.cloud.consul.discovery.health-check-urlspring-doc.cn

Custom health check url to override default.spring-doc.cn

spring.cloud.consul.discovery.heartbeat.actuator-health-groupspring-doc.cn

The actuator health group to use (null for the root group) when determining system health via Actuator.spring-doc.cn

spring.cloud.consul.discovery.heartbeat.enabledspring-doc.cn

falsespring-doc.cn

spring.cloud.consul.discovery.heartbeat.interval-ratiospring-doc.cn

spring.cloud.consul.discovery.heartbeat.reregister-service-on-failurespring-doc.cn

falsespring-doc.cn

spring.cloud.consul.discovery.heartbeat.ttlspring-doc.cn

30sspring-doc.cn

spring.cloud.consul.discovery.heartbeat.use-actuator-healthspring-doc.cn

truespring-doc.cn

Whether or not to take the current system health (as reported via the Actuator Health endpoint) into account when reporting the application status to the Consul TTL check. Actuator Health endpoint also has to be available to the application.spring-doc.cn

spring.cloud.consul.discovery.hostnamespring-doc.cn

Hostname to use when accessing server.spring-doc.cn

spring.cloud.consul.discovery.include-hostname-in-instance-idspring-doc.cn

falsespring-doc.cn

Whether hostname is included into the default instance id when registering service.spring-doc.cn

spring.cloud.consul.discovery.instance-groupspring-doc.cn

Service instance group.spring-doc.cn

spring.cloud.consul.discovery.instance-idspring-doc.cn

Unique service instance id.spring-doc.cn

spring.cloud.consul.discovery.instance-zonespring-doc.cn

Service instance zone.spring-doc.cn

spring.cloud.consul.discovery.ip-addressspring-doc.cn

IP address to use when accessing service (must also set preferIpAddress to use).spring-doc.cn

spring.cloud.consul.discovery.lifecycle.enabledspring-doc.cn

truespring-doc.cn

spring.cloud.consul.discovery.management-enable-tag-overridespring-doc.cn

Enable tag override for the registered management service.spring-doc.cn

spring.cloud.consul.discovery.management-metadataspring-doc.cn

Metadata to use when registering management service.spring-doc.cn

spring.cloud.consul.discovery.management-portspring-doc.cn

Port to register the management service under (defaults to management port).spring-doc.cn

spring.cloud.consul.discovery.management-suffixspring-doc.cn

managementspring-doc.cn

Suffix to use when registering management service.spring-doc.cn

spring.cloud.consul.discovery.management-tagsspring-doc.cn

Tags to use when registering management service.spring-doc.cn

spring.cloud.consul.discovery.metadataspring-doc.cn

Metadata to use when registering service.spring-doc.cn

spring.cloud.consul.discovery.orderspring-doc.cn

0spring-doc.cn

Order of the discovery client used by CompositeDiscoveryClient for sorting available clients.spring-doc.cn

spring.cloud.consul.discovery.portspring-doc.cn

Port to register the service under (defaults to listening port).spring-doc.cn

spring.cloud.consul.discovery.prefer-agent-addressspring-doc.cn

falsespring-doc.cn

Source of how we will determine the address to use.spring-doc.cn

spring.cloud.consul.discovery.prefer-ip-addressspring-doc.cn

falsespring-doc.cn

Use ip address rather than hostname during registration.spring-doc.cn

spring.cloud.consul.discovery.query-passingspring-doc.cn

falsespring-doc.cn

Add the 'passing` parameter to /v1/health/service/serviceName. This pushes health check passing to the server.spring-doc.cn

spring.cloud.consul.discovery.registerspring-doc.cn

truespring-doc.cn

Register as a service in consul.spring-doc.cn

spring.cloud.consul.discovery.register-health-checkspring-doc.cn

truespring-doc.cn

Register health check in consul. Useful during development of a service.spring-doc.cn

spring.cloud.consul.discovery.schemespring-doc.cn

httpspring-doc.cn

Whether to register an http or https service.spring-doc.cn

spring.cloud.consul.discovery.server-list-query-tagsspring-doc.cn

Map of serviceId’s → tag to query for in server list. This allows filtering services by one more tags. Multiple tags can be specified with a comma separated value.spring-doc.cn

spring.cloud.consul.discovery.service-namespring-doc.cn

Service name.spring-doc.cn

spring.cloud.consul.discovery.tagsspring-doc.cn

Tags to use when registering service.spring-doc.cn

spring.cloud.consul.enabledspring-doc.cn

truespring-doc.cn

Is spring cloud consul enabled.spring-doc.cn

spring.cloud.consul.hostspring-doc.cn

localhostspring-doc.cn

Consul agent hostname. Defaults to 'localhost'.spring-doc.cn

spring.cloud.consul.pathspring-doc.cn

Custom path if consul is under non-root.spring-doc.cn

spring.cloud.consul.portspring-doc.cn

8500spring-doc.cn

Consul agent port. Defaults to '8500'.spring-doc.cn

spring.cloud.consul.retry.enabledspring-doc.cn

truespring-doc.cn

If consul retry is enabled.spring-doc.cn

spring.cloud.consul.retry.initial-intervalspring-doc.cn

1000spring-doc.cn

Initial retry interval in milliseconds.spring-doc.cn

spring.cloud.consul.retry.max-attemptsspring-doc.cn

6spring-doc.cn

Maximum number of attempts.spring-doc.cn

spring.cloud.consul.retry.max-intervalspring-doc.cn

2000spring-doc.cn

Maximum interval for backoff.spring-doc.cn

spring.cloud.consul.retry.multiplierspring-doc.cn

1.1spring-doc.cn

Multiplier for next interval.spring-doc.cn

spring.cloud.consul.ribbon.enabledspring-doc.cn

truespring-doc.cn

Enables Consul and Ribbon integration.spring-doc.cn

spring.cloud.consul.schemespring-doc.cn

Consul agent scheme (HTTP/HTTPS). If there is no scheme in address - client will use HTTP.spring-doc.cn

spring.cloud.consul.service-registry.auto-registration.enabledspring-doc.cn

truespring-doc.cn

Enables Consul Service Registry Auto-registration.spring-doc.cn

spring.cloud.consul.service-registry.enabledspring-doc.cn

truespring-doc.cn

Enables Consul Service Registry functionality.spring-doc.cn

spring.cloud.consul.tls.certificate-passwordspring-doc.cn

Password to open the certificate.spring-doc.cn

spring.cloud.consul.tls.certificate-pathspring-doc.cn

File path to the certificate.spring-doc.cn

spring.cloud.consul.tls.key-store-instance-typespring-doc.cn

Type of key framework to use.spring-doc.cn

spring.cloud.consul.tls.key-store-passwordspring-doc.cn

Password to an external keystore.spring-doc.cn

spring.cloud.consul.tls.key-store-pathspring-doc.cn

Path to an external keystore.spring-doc.cn