For the latest stable version, please use Spring Cloud Zookeeper 4.2.0!

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 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.config.default-context

application

The name of the default context.

spring.cloud.zookeeper.config.enabled

true

spring.cloud.zookeeper.config.fail-fast

true

Throw exceptions during config lookup if true, otherwise, log warnings.

spring.cloud.zookeeper.config.name

Alternative to spring.application.name to use in looking up values in zookeeper.

spring.cloud.zookeeper.config.profile-separator

,

Separator for profile appended to the application name.

spring.cloud.zookeeper.config.root

config

Root folder where the configuration for Zookeeper is kept.

spring.cloud.zookeeper.connect-string

localhost:2181

Connection string to the Zookeeper cluster.

spring.cloud.zookeeper.connection-timeout

The configured connection timeout in milliseconds.

spring.cloud.zookeeper.dependencies

Mapping of alias to ZookeeperDependency. From LoadBalancer perspective the alias is actually serviceID since SC LoadBalancer 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.

spring.cloud.zookeeper.session-timeout

The configured/negotiated session timeout in milliseconds. Please refer to <a href='https://cwiki.apache.org/confluence/display/CURATOR/TN14'>Curator’s Tech Note 14</a> to understand how Curator implements connection sessions. @see <a href='https://cwiki.apache.org/confluence/display/CURATOR/TN14'>Curator’s Tech Note 14</a>