The Spring Config Server Store extends the Vert.x Configuration Retriever and provides the a way to retrieve configuration from a Spring Server.

Using the Spring Config Server Store

To use the Spring Config Server Store, add the following dependency to the dependencies section of your build descriptor:

  • Maven (in your pom.xml):

<dependency>
  <groupId>io.vertx</groupId>
  <artifactId>vertx-config-spring-config-server</artifactId>
  <version>3.4.0.Beta1</version>
</dependency>
<dependency>
  <groupId>io.vertx</groupId>
  <artifactId>vertx-config</artifactId>
  <version>3.4.0.Beta1</version>
</dependency>
  • Gradle (in your build.gradle file):

compile 'io.vertx:vertx-config:3.4.0.Beta1'
compile 'io.vertx:vertx-config-spring-config-server:3.4.0.Beta1'

Configuring the store

Once added to your classpath or dependencies, you need to configure the ConfigRetriever to use this store:

import io.vertx.config.ConfigRetriever
import io.vertx.config.ConfigRetrieverOptions
import io.vertx.config.ConfigStoreOptions
import io.vertx.kotlin.config.*
import io.vertx.kotlin.core.json.*

var store = ConfigStoreOptions(
  type = "spring-config-server",
  config = json {
    obj("url" to "http://localhost:8888/foo/development")
  })

var retriever = ConfigRetriever.create(vertx, ConfigRetrieverOptions(
  stores = listOf(store)))

Configurable attributes are:

  • url - the url to retrieve the configuration (mandatory)

  • timeout - the timeout (in milliseconds) to retrieve the configuration, 3000 by default

  • user - the user (no authentication by default)

  • password - the password

  • httpClientConfiguration - the configuration of the underlying HTTP client