=== Consul Configuration Store

The Consul Configuration Store extends the Vert.x Configuration Retriever and provides the
way to retrieve configuration from a https://www.consul.io[Consul].

==== Using the Consul Configuration Store

To use the Consul Configuration Store, add the following dependency to the
_dependencies_ section of your build descriptor:

* Maven (in your `pom.xml`):

[source,xml,subs="+attributes"]
----
<dependency>
 <groupId>io.vertx</groupId>
 <artifactId>vertx-config-consul</artifactId>
 <version>3.6.0.CR2</version>
</dependency>
<dependency>
 <groupId>io.vertx</groupId>
 <artifactId>vertx-config</artifactId>
 <version>3.6.0.CR2</version>
</dependency>
----

* Gradle (in your `build.gradle` file):

[source,groovy,subs="+attributes"]
----
compile 'io.vertx:vertx-config:3.6.0.CR2'
compile 'io.vertx:vertx-config-consul:3.6.0.CR2'
----

==== Configuring the store

Once added to your classpath or dependencies, you need to configure the
`link:../../yardoc/VertxConfig/ConfigRetriever.html[ConfigRetriever]` to use this store:

[source, ruby]
----
require 'vertx-config/config_retriever'
store = {
  'type' => "consul",
  'config' => {
    'host' => "localhost",
    'port' => 8500,
    'prefix' => "foo"
  }
}

retriever = VertxConfig::ConfigRetriever.create(vertx, {
  'stores' => [
    store
  ]
})

----

The store configuration is used to create an instance of
`link:../../yardoc/VertxConsul/ConsulClient.html[ConsulClient]`. Check the documentation of the Vert.x Consul Client
for further details. And this is the parameters specific to the Consul Configuration Store:

`prefix`:: A prefix that will not be taken into account when building the configuration tree. Defaults to empty.
`delimiter`:: Symbol that used to split keys in the Consul storage to obtain levels in the configuration tree. Defaults to "/".