Configuration 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 Zookeeper properties and references to the underlying classes that consume them.

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.zookeeper.base-sleep-time-ms

50

Initial amount of time to wait between retries.

spring.cloud.zookeeper.block-until-connected-unit

The unit of time related to blocking on connection to Zookeeper.

spring.cloud.zookeeper.block-until-connected-wait

10

Wait time to block on connection to Zookeeper.

spring.cloud.zookeeper.connect-string

localhost:2181

Connection string to the Zookeeper cluster.

spring.cloud.zookeeper.default-health-endpoint

Default health endpoint that will be checked to verify that a dependency is alive.

spring.cloud.zookeeper.dependencies

Mapping of alias to ZookeeperDependency. From Ribbon perspective the alias is actually serviceID since Ribbon can’t accept nested structures in serviceID.

spring.cloud.zookeeper.dependency-configurations

spring.cloud.zookeeper.dependency-names

spring.cloud.zookeeper.discovery.enabled

true

spring.cloud.zookeeper.discovery.initial-status

The initial status of this instance (defaults to {@link StatusConstants#STATUS_UP}).

spring.cloud.zookeeper.discovery.instance-host

Predefined host with which a service can register itself in Zookeeper. Corresponds to the {code address} from the URI spec.

spring.cloud.zookeeper.discovery.instance-id

Id used to register with zookeeper. Defaults to a random UUID.

spring.cloud.zookeeper.discovery.instance-port

Port to register the service under (defaults to listening port).

spring.cloud.zookeeper.discovery.instance-ssl-port

Ssl port of the registered service.

spring.cloud.zookeeper.discovery.metadata

Gets the metadata name/value pairs associated with this instance. This information is sent to zookeeper and can be used by other instances.

spring.cloud.zookeeper.discovery.order

0

Order of the discovery client used by CompositeDiscoveryClient for sorting available clients.

spring.cloud.zookeeper.discovery.register

true

Register as a service in zookeeper.

spring.cloud.zookeeper.discovery.root

/services

Root Zookeeper folder in which all instances are registered.

spring.cloud.zookeeper.discovery.uri-spec

{scheme}://{address}:{port}

The URI specification to resolve during service registration in Zookeeper.

spring.cloud.zookeeper.enabled

true

Is Zookeeper enabled.

spring.cloud.zookeeper.max-retries

10

Max number of times to retry.

spring.cloud.zookeeper.max-sleep-ms

500

Max time in ms to sleep on each retry.

spring.cloud.zookeeper.prefix

Common prefix that will be applied to all Zookeeper dependencies' paths.