use of io.vertx.spi.cluster.zookeeper.ZookeeperClusterManager in project vertx-examples by vert-x3.
the class MainClassNode1 method main.
public static void main(String[] args) {
JsonObject zkConfig = configureClusterManager();
ClusterManager zookeeperClusterManager = new ZookeeperClusterManager(zkConfig);
VertxOptions options = configureVertx(zookeeperClusterManager);
Vertx.clusteredVertx(options, res -> {
if (res.succeeded()) {
Vertx vertx = res.result();
DeploymentOptions deploymentOptions = new DeploymentOptions().setInstances(2);
vertx.deployVerticle("verticle.SenderVerticle", deploymentOptions);
System.out.println("Sender verticle deployed");
}
});
}
use of io.vertx.spi.cluster.zookeeper.ZookeeperClusterManager in project vertx-examples by vert-x3.
the class MainClassNode2 method main.
public static void main(String[] args) {
JsonObject zkConfig = configureClusterManager();
ClusterManager zookeeperClusterManager = new ZookeeperClusterManager(zkConfig);
VertxOptions options = configureVertx(zookeeperClusterManager);
Vertx.clusteredVertx(options, res -> {
if (res.succeeded()) {
Vertx vertx = res.result();
DeploymentOptions deploymentOptions = new DeploymentOptions().setInstances(2);
vertx.deployVerticle("verticle.ConsumerVerticle", deploymentOptions);
System.out.println("consumer verticle deployed");
}
});
}
Aggregations