vertx / io.vertx.config / ConfigRetriever

ConfigRetriever

interface ConfigRetriever

Defines a configuration retriever that read configuration from ConfigStore and tracks changes periodically.

Author
Clement Escoffier

Functions

close

abstract fun close(): Unit

Closes the retriever.

configStream

abstract fun configStream(): ReadStream<JsonObject>

create

open static fun create(vertx: Vertx, options: ConfigRetrieverOptions): ConfigRetriever

Creates an instance of the default implementation of the ConfigRetriever.

open static fun create(vertx: Vertx): ConfigRetriever

Creates an instance of the default implementation of the ConfigRetriever, using the default settings (json file, system properties and environment variables).

getCachedConfig

abstract fun getCachedConfig(): JsonObject

Gets the last computed configuration.

getConfig

abstract fun getConfig(completionHandler: Handler<AsyncResult<JsonObject>>): Unit

Reads the configuration from the different ConfigStore and computes the final configuration.

getConfigAsFuture

open static fun getConfigAsFuture(retriever: ConfigRetriever): Future<JsonObject>

Same as ConfigRetriever#getConfig(Handler), but returning a Future object. The result is a JsonObject.

listen

abstract fun listen(listener: Handler<ConfigChange>): Unit

Registers a listener receiving configuration changes. This method cannot only be called if the configuration is broadcasted.