Class ZookeeperPropertySourceLocator

java.lang.Object
org.springframework.cloud.zookeeper.config.ZookeeperPropertySourceLocator
All Implemented Interfaces:
org.springframework.cloud.bootstrap.config.PropertySourceLocator

public class ZookeeperPropertySourceLocator extends Object implements org.springframework.cloud.bootstrap.config.PropertySourceLocator
Zookeeper provides a hierarchical namespace that allows clients to store arbitrary data, such as configuration data. Spring Cloud Zookeeper 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 namespace 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 is the config/application namespace are applicable to all applications using zookeeper for configuration. Properties in the config/testApp namespace are only available to the instances of the service named "testApp".
Since:
1.0.0
Author:
Spencer Gibb
  • Constructor Details

    • ZookeeperPropertySourceLocator

      public ZookeeperPropertySourceLocator(org.apache.curator.framework.CuratorFramework curator, ZookeeperConfigProperties properties)
  • Method Details

    • getContexts

      public List<String> getContexts()
    • locate

      public org.springframework.core.env.PropertySource<?> locate(org.springframework.core.env.Environment environment)
      Specified by:
      locate in interface org.springframework.cloud.bootstrap.config.PropertySourceLocator
    • destroy

      @PreDestroy public void destroy()