### Redis backend

The service discovery has a plug-able backend using the `ServiceDiscoveryBackend` SPI. This is an implementation of the SPI based on Redis.

#### Using the Redis backend

To use the Redis backend, add the following dependency to the dependencies section of your build descriptor:

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

    <dependency>
     <groupId>io.vertx</groupId>
     <artifactId>vertx-service-discovery-backend-redis</artifactId>
     <version>3.9.0</version>
    </dependency>

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

    compile 'io.vertx:vertx-service-discovery-backend-redis:3.9.0'

Be aware that you can have only a single implementation of the SPI in your classpath. If none, the default backend is used.

#### Configuration

The backend is based on the vertx-redis-client. The configuration is the client configuration as well as `key` indicating in which key on Redis the records are stored.

Here is an example:

    ServiceDiscovery.create(vertx, ServiceDiscoveryOptions(
      backendConfiguration = json {
        obj(
          "host" to "127.0.0.1",
          "key" to "records"
        )
      }))

It’s important to note that the backend configuration is passed in the `setBackendConfiguration` method (or `backendConfiguration` entry if you use JSON):

    ServiceDiscovery.create(vertx, ServiceDiscoveryOptions(
      backendConfiguration = json {
        obj(
          "host" to "localhost",
          "port" to 1234,
          "key" to "my-records"
        )
      }))