Skip navigation links

Package io.vertx.servicediscovery.zookeeper

=== Zookeeper bridge This discovery bridge imports services from https://zookeeper.apache.org/[Apache Zookeeper] into the Vert.x service discovery.

See: Description

Package io.vertx.servicediscovery.zookeeper Description

=== Zookeeper bridge This discovery bridge imports services from https://zookeeper.apache.org/[Apache Zookeeper] into the Vert.x service discovery. The bridge uses the http://curator.apache.org/curator-x-discovery/[Curator extension for service discovery]. Service description are read as JSON Object (merged in the Vert.x service record metadata). The service type is deduced from this description by reading the `service-type`. ==== Using the bridge To use this Vert.x discovery bridge, add the following dependency to the _dependencies_ section of your build descriptor: * Maven (in your `pom.xml`): [source,xml,subs="+attributes"] ---- ${maven.groupId} ${maven.artifactId} ${maven.version} ---- * Gradle (in your `build.gradle` file): [source,groovy,subs="+attributes"] ---- compile '${maven.groupId}:${maven.artifactId}:${maven.version}' ---- Then, when creating the service discovery registers this bridge as follows: [source, $lang] ---- examples.Examples#register(io.vertx.core.Vertx) ---- Only the `connection` configuration is mandatory. It's the connection _string_ of the Zookeeper server. In addition you can configure: * `maxRetries`: the number of connection attempt, 3 by default * `baseSleepTimeBetweenRetries`: the amount of milliseconds to wait between retries (exponential backoff strategy). 1000 ms by default. * `basePath`: the Zookeeper path in which the service are stored. Default to `/discovery`. * `connectionTimeoutMs`: the connection timeout in milliseconds. Defaults to 1000. * `canBeReadOnly` : whether or not the backend support the _read-only_ mode (defaults to true) [source,$lang] ---- examples.Examples#register2(io.vertx.core.Vertx) ----
Skip navigation links

Copyright © 2018. All rights reserved.