Repository: eclipse-vertx/vert.x

Problem statement:
Deprecate EventBusOptions delegates in VertxOptions
We had a 2 days effort because the API is misleading:

	VertxOptions options = new VertxOptions()
		.setClustered(true)
		.setClusterHost("10.x.y.z")
		.setClusterPort(60000);
	
	System.out.println(options);
	
	options
		.setEventBusOptions(new EventBusOptions()
			.setSsl(true)
			.setKeyStoreOptions(new JksOptions())
		);
	
	System.out.println(options);

This will result in:

    VertxOptions{..., eventbus={"clustered":true,"host":"10.x.y.z","port":60000,"ssl":false, ...}
    VertxOptions{..., eventbus={"clustered":false,"host":"localhost","port":0,"ssl":true, ...}

But I expected:

    VertxOptions{..., eventbus={"clustered":true,"host":"10.x.y.z","port":60000,"ssl":false, ...}
    VertxOptions{..., eventbus={"clustered":true,"host":"10.x.y.z","port":60000,"ssl":true, ...}

In my opinion the API should be changed in order to reduce the confusion. If I configure an option it should not be changed after setting other options.

Workaround #1:

	VertxOptions options = new VertxOptions()
		// set event bus options at first
		.setEventBusOptions(new EventBusOptions()
			.setSsl(true)
			.setKeyStoreOptions(new JksOptions()))
		.setClustered(true)
		.setClusterHost("10.x.y.z")
		.setClusterPort(60000);

Workaround #2:

	VertxOptions options = new VertxOptions()
		.setClustered(true)
		.setClusterHost("10.x.y.z")
		.setClusterPort(60000);
	
	// do not overwrite event bus options but change the default one
	options.getEventBusOptions()
		.setSsl(true)
		.setKeyStoreOptions(new JksOptions());


Hints:
@gofabian I agree with you this should be changed in vertx 4 and perhaps we need to remove the top level setters on VertxOptions 
we do have something similar with metrics and file system options
+1

I believe this was added because initially we didn't have the -options arg
on the command line (externalized options).

It's less useful now. If we do this we should deprecate the corresponding
options in 3.7 though

yes pretty much like FileSystemOptions



> On 14 Mar 2019, at 17:12, Thomas Segismont <notifications@github.com> wrote:
> 
> +1
> 
> I believe this was added because initially we didn't have the -options arg
> on the command line (externalized options).
> 
> It's less useful now. If we do this we should deprecate the corresponding
> options in 3.7 though
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub <https://github.com/eclipse-vertx/vert.x/issues/2873#issuecomment-472940633>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AANxinZSW_lQf-xu_seE3uOGDjPDPh54ks5vWnT5gaJpZM4boCrM>.
> 


I'll take care of it then.
what do you mean ?
we can't remove that in 3.7 only mark it as deprecated and remove it in master
Yes, I didn't mean anything else.

😅 that was not clear enough to me :-)

Patch:
diff --git a/src/main/java/io/vertx/core/Starter.java b/src/main/java/io/vertx/core/Starter.java
--- a/src/main/java/io/vertx/core/Starter.java
+++ b/src/main/java/io/vertx/core/Starter.java
@@ -211,7 +211,7 @@ private Vertx startVertx(boolean clustered, boolean ha, Args args) {
       CountDownLatch latch = new CountDownLatch(1);
       AtomicReference<AsyncResult<Vertx>> result = new AtomicReference<>();
 
-      options.setClusterHost(clusterHost).setClusterPort(clusterPort).setClustered(true);
+      options.getEventBusOptions().setClustered(true).setHost(clusterHost).setPort(clusterPort);
       if (ha) {
         String haGroup = args.map.get("-hagroup");
         int quorumSize = args.getInt("-quorum");
diff --git a/src/main/java/io/vertx/core/VertxOptions.java b/src/main/java/io/vertx/core/VertxOptions.java
--- a/src/main/java/io/vertx/core/VertxOptions.java
+++ b/src/main/java/io/vertx/core/VertxOptions.java
@@ -50,37 +50,58 @@ public class VertxOptions {
 
   /**
    * The default value of whether Vert.x is clustered = false.
+   *
+   * @deprecated as of 3.7, use {@link EventBusOptions#DEFAULT_CLUSTERED} instead
    */
+  @Deprecated
   public static final boolean DEFAULT_CLUSTERED = false;
 
   /**
    * The default hostname to use when clustering = "localhost"
+   *
+   * @deprecated as of 3.7, use {@link EventBusOptions#DEFAULT_CLUSTER_HOST} instead
    */
+  @Deprecated
   public static final String DEFAULT_CLUSTER_HOST = "localhost";
 
   /**
    * The default port to use when clustering = 0 (meaning assign a random port)
+   *
+   * @deprecated as of 3.7, use {@link EventBusOptions#DEFAULT_CLUSTER_PORT} instead
    */
+  @Deprecated
   public static final int DEFAULT_CLUSTER_PORT = 0;
 
   /**
    * The default cluster public host to use = null which means use the same as the cluster host
+   *
+   * @deprecated as of 3.7, use {@link EventBusOptions#DEFAULT_CLUSTER_PUBLIC_HOST} instead
    */
+  @Deprecated
   public static final String DEFAULT_CLUSTER_PUBLIC_HOST = null;
 
   /**
    * The default cluster public port to use = -1 which means use the same as the cluster port
+   *
+   * @deprecated as of 3.7, use {@link EventBusOptions#DEFAULT_CLUSTER_PUBLIC_PORT} instead
    */
+  @Deprecated
   public static final int DEFAULT_CLUSTER_PUBLIC_PORT = -1;
 
   /**
    * The default value of cluster ping interval = 20000 ms.
+   *
+   * @deprecated as of 3.7, use {@link EventBusOptions#DEFAULT_CLUSTER_PING_INTERVAL} instead
    */
+  @Deprecated
   public static final long DEFAULT_CLUSTER_PING_INTERVAL = 20000;
 
   /**
    * The default value of cluster ping reply interval = 20000 ms.
+   *
+   * @deprecated as of 3.7, use {@link EventBusOptions#DEFAULT_CLUSTER_PING_REPLY_INTERVAL} instead
    */
+  @Deprecated
   public static final long DEFAULT_CLUSTER_PING_REPLY_INTERVAL = 20000;
 
   /**
@@ -261,7 +282,10 @@ public VertxOptions setWorkerPoolSize(int workerPoolSize) {
    * Is the Vert.x instance clustered?
    *
    * @return true if clustered, false if not
+   *
+   * @deprecated as of 3.7, use {@link #getEventBusOptions()} and then {@link EventBusOptions#isClustered()} instead
    */
+  @Deprecated
   public boolean isClustered() {
     return eventBusOptions.isClustered();
   }
@@ -271,7 +295,10 @@ public boolean isClustered() {
    *
    * @param clustered if true, the Vert.x instance will be clustered, otherwise not
    * @return a reference to this, so the API can be used fluently
+   *
+   * @deprecated as of 3.7, use {@link #getEventBusOptions()} and then {@link EventBusOptions#setClustered(boolean)} instead
    */
+  @Deprecated
   public VertxOptions setClustered(boolean clustered) {
     eventBusOptions.setClustered(clustered);
     return this;
@@ -281,7 +308,10 @@ public VertxOptions setClustered(boolean clustered) {
    * Get the host name to be used for clustering.
    *
    * @return The host name
+   *
+   * @deprecated as of 3.7, use {@link #getEventBusOptions()} and then {@link EventBusOptions#getHost()} instead
    */
+  @Deprecated
   public String getClusterHost() {
     return eventBusOptions.getHost();
   }
@@ -291,7 +321,10 @@ public String getClusterHost() {
    *
    * @param clusterHost the host name to use
    * @return a reference to this, so the API can be used fluently
+   *
+   * @deprecated as of 3.7, use {@link #getEventBusOptions()} and then {@link EventBusOptions#setHost(String)} instead
    */
+  @Deprecated
   public VertxOptions setClusterHost(String clusterHost) {
     this.eventBusOptions.setHost(clusterHost);
     return this;
@@ -301,7 +334,10 @@ public VertxOptions setClusterHost(String clusterHost) {
    * Get the public facing hostname to be used when clustering.
    *
    * @return the public facing hostname
+   *
+   * @deprecated as of 3.7, use {@link #getEventBusOptions()} and then {@link EventBusOptions#getClusterPublicHost()} instead
    */
+  @Deprecated
   public String getClusterPublicHost() {
     return getEventBusOptions().getClusterPublicHost();
   }
@@ -315,7 +351,10 @@ public String getClusterPublicHost() {
    *
    * @param clusterPublicHost the public host name to use
    * @return a reference to this, so the API can be used fluently
+   *
+   * @deprecated as of 3.7, use {@link #getEventBusOptions()} and then {@link EventBusOptions#setClusterPublicHost(String)} instead
    */
+  @Deprecated
   public VertxOptions setClusterPublicHost(String clusterPublicHost) {
     getEventBusOptions().setClusterPublicHost(clusterPublicHost);
     return this;
@@ -325,7 +364,10 @@ public VertxOptions setClusterPublicHost(String clusterPublicHost) {
    * Get the port to be used for clustering
    *
    * @return the port
+   *
+   * @deprecated as of 3.7, use {@link #getEventBusOptions()} and then {@link EventBusOptions#getPort()} instead
    */
+  @Deprecated
   public int getClusterPort() {
     return eventBusOptions.getPort();
   }
@@ -335,7 +377,10 @@ public int getClusterPort() {
    *
    * @param clusterPort the port
    * @return a reference to this, so the API can be used fluently
+   *
+   * @deprecated as of 3.7, use {@link #getEventBusOptions()} and then {@link EventBusOptions#setPort(int)} instead
    */
+  @Deprecated
   public VertxOptions setClusterPort(int clusterPort) {
     eventBusOptions.setPort(clusterPort);
     return this;
@@ -345,7 +390,10 @@ public VertxOptions setClusterPort(int clusterPort) {
    * Get the public facing port to be used when clustering.
    *
    * @return the public facing port
+   *
+   * @deprecated as of 3.7, use {@link #getEventBusOptions()} and then {@link EventBusOptions#getClusterPublicPort()} instead
    */
+  @Deprecated
   public int getClusterPublicPort() {
     return eventBusOptions.getClusterPublicPort();
   }
@@ -355,7 +403,10 @@ public int getClusterPublicPort() {
    *
    * @param clusterPublicPort the public port to use
    * @return a reference to this, so the API can be used fluently
+   *
+   * @deprecated as of 3.7, use {@link #getEventBusOptions()} and then {@link EventBusOptions#setClusterPublicPort(int)} instead
    */
+  @Deprecated
   public VertxOptions setClusterPublicPort(int clusterPublicPort) {
     getEventBusOptions().setClusterPublicPort(clusterPublicPort);
     return this;
@@ -367,7 +418,10 @@ public VertxOptions setClusterPublicPort(int clusterPublicPort) {
    * Nodes in the cluster ping each other at this interval to determine whether they are still running.
    *
    * @return The value of cluster ping interval
+   *
+   * @deprecated as of 3.7, use {@link #getEventBusOptions()} and then {@link EventBusOptions#getClusterPingInterval()} instead
    */
+  @Deprecated
   public long getClusterPingInterval() {
     return getEventBusOptions().getClusterPingInterval();
   }
@@ -377,7 +431,10 @@ public long getClusterPingInterval() {
    *
    * @param clusterPingInterval The value of cluster ping interval, in ms.
    * @return a reference to this, so the API can be used fluently
+   *
+   * @deprecated as of 3.7, use {@link #getEventBusOptions()} and then {@link EventBusOptions#setClusterPingInterval(long)} instead
    */
+  @Deprecated
   public VertxOptions setClusterPingInterval(long clusterPingInterval) {
     eventBusOptions.setClusterPingInterval(clusterPingInterval);
     return this;
@@ -389,7 +446,9 @@ public VertxOptions setClusterPingInterval(long clusterPingInterval) {
    * After sending a ping, if a pong is not received in this time, the node will be considered dead.
    *
    * @return the value of cluster ping reply interval
+   * @deprecated as of 3.7, use {@link #getEventBusOptions()} and then {@link EventBusOptions#getClusterPingReplyInterval()} instead
    */
+  @Deprecated
   public long getClusterPingReplyInterval() {
     return eventBusOptions.getClusterPingReplyInterval();
   }
@@ -399,7 +458,10 @@ public long getClusterPingReplyInterval() {
    *
    * @param clusterPingReplyInterval The value of cluster ping reply interval, in ms.
    * @return a reference to this, so the API can be used fluently
+   *
+   * @deprecated as of 3.7, use {@link #getEventBusOptions()} and then {@link EventBusOptions#setClusterPingReplyInterval(long)} instead
    */
+  @Deprecated
   public VertxOptions setClusterPingReplyInterval(long clusterPingReplyInterval) {
     eventBusOptions.setClusterPingReplyInterval(clusterPingReplyInterval);
     return this;
diff --git a/src/main/java/io/vertx/core/eventbus/EventBusOptions.java b/src/main/java/io/vertx/core/eventbus/EventBusOptions.java
--- a/src/main/java/io/vertx/core/eventbus/EventBusOptions.java
+++ b/src/main/java/io/vertx/core/eventbus/EventBusOptions.java
@@ -29,23 +29,58 @@
 @DataObject(generateConverter = true, inheritConverter = true, publicConverter = false)
 public class EventBusOptions extends TCPSSLOptions {
 
-  private boolean clustered = VertxOptions.DEFAULT_CLUSTERED;
-  private String clusterPublicHost = VertxOptions.DEFAULT_CLUSTER_PUBLIC_HOST;
-  private int clusterPublicPort = VertxOptions.DEFAULT_CLUSTER_PUBLIC_PORT;
-  private long clusterPingInterval = VertxOptions.DEFAULT_CLUSTER_PING_INTERVAL;
-  private long clusterPingReplyInterval = VertxOptions.DEFAULT_CLUSTER_PING_REPLY_INTERVAL;
+  /**
+   * The default value of whether Vert.x is clustered = false.
+   */
+  public static final boolean DEFAULT_CLUSTERED = VertxOptions.DEFAULT_CLUSTERED;
+
+  /**
+   * The default hostname to use when clustering = "localhost"
+   */
+  public static final String DEFAULT_CLUSTER_HOST = VertxOptions.DEFAULT_CLUSTER_HOST;
+
+  /**
+   * The default port to use when clustering = 0 (meaning assign a random port)
+   */
+  public static final int DEFAULT_CLUSTER_PORT = VertxOptions.DEFAULT_CLUSTER_PORT;
+
+  /**
+   * The default cluster public host to use = null which means use the same as the cluster host
+   */
+  public static final String DEFAULT_CLUSTER_PUBLIC_HOST = VertxOptions.DEFAULT_CLUSTER_PUBLIC_HOST;
+
+  /**
+   * The default cluster public port to use = -1 which means use the same as the cluster port
+   */
+  public static final int DEFAULT_CLUSTER_PUBLIC_PORT = VertxOptions.DEFAULT_CLUSTER_PUBLIC_PORT;
+
+  /**
+   * The default value of cluster ping interval = 20000 ms.
+   */
+  public static final long DEFAULT_CLUSTER_PING_INTERVAL = VertxOptions.DEFAULT_CLUSTER_PING_INTERVAL;
+
+  /**
+   * The default value of cluster ping reply interval = 20000 ms.
+   */
+  public static final long DEFAULT_CLUSTER_PING_REPLY_INTERVAL = VertxOptions.DEFAULT_CLUSTER_PING_REPLY_INTERVAL;
+
+  private boolean clustered = DEFAULT_CLUSTERED;
+  private String clusterPublicHost = DEFAULT_CLUSTER_PUBLIC_HOST;
+  private int clusterPublicPort = DEFAULT_CLUSTER_PUBLIC_PORT;
+  private long clusterPingInterval = DEFAULT_CLUSTER_PING_INTERVAL;
+  private long clusterPingReplyInterval = DEFAULT_CLUSTER_PING_REPLY_INTERVAL;
 
   // Attributes used to configure the server of the event bus when the event bus is clustered.
 
   /**
    * The default port to listen on = 0 (meaning a random ephemeral free port will be chosen)
    */
-  public static final int DEFAULT_PORT = VertxOptions.DEFAULT_CLUSTER_PORT;
+  public static final int DEFAULT_PORT = DEFAULT_CLUSTER_PORT;
 
   /**
    * The default host to listen on = "0.0.0.0" (meaning listen on all available interfaces).
    */
-  public static final String DEFAULT_HOST = VertxOptions.DEFAULT_CLUSTER_HOST;
+  public static final String DEFAULT_HOST = DEFAULT_CLUSTER_HOST;
 
   /**
    * The default accept backlog = 1024
@@ -96,7 +131,7 @@ public class EventBusOptions extends TCPSSLOptions {
   public EventBusOptions() {
     super();
 
-    clustered = VertxOptions.DEFAULT_CLUSTERED;
+    clustered = DEFAULT_CLUSTERED;
 
     port = DEFAULT_PORT;
     host = DEFAULT_HOST;
@@ -201,9 +236,7 @@ public EventBusOptions setAcceptBacklog(int acceptBacklog) {
   }
 
   /**
-   * @return the host, which can be configured from the {@link VertxOptions#setClusterHost(String)}, or using
-   * the {@code --cluster-host} command line option.
-   * @see NetServerOptions#getHost()
+   * @return the host
    */
   public String getHost() {
     return host;
@@ -476,9 +509,7 @@ public EventBusOptions setLogActivity(boolean logEnabled) {
   }
 
   /**
-   * @return whether or not the event bus is clustered. This can be configured from the
-   * {@link VertxOptions#setClustered(boolean)} method or from the {@code --cluster} option from the command
-   * line.
+   * @return whether or not the event bus is clustered
    */
   public boolean isClustered() {
     return clustered;
@@ -538,8 +569,6 @@ public EventBusOptions setConnectTimeout(int connectTimeout) {
   /**
    * Get the value of cluster ping reply interval, in ms.
    * After sending a ping, if a pong is not received in this time, the node will be considered dead.
-   * <p>
-   * The value can be configured from {@link VertxOptions#setClusterPingInterval(long)}.
    *
    * @return the value of cluster ping reply interval
    */
@@ -564,8 +593,6 @@ public EventBusOptions setClusterPingInterval(long clusterPingInterval) {
   /**
    * Get the value of cluster ping reply interval, in ms.
    * After sending a ping, if a pong is not received in this time, the node will be considered dead.
-   * <p>
-   * The value can be configured from {@link VertxOptions#setClusterPingReplyInterval(long)}}.
    *
    * @return the value of cluster ping reply interval
    */
@@ -588,9 +615,7 @@ public EventBusOptions setClusterPingReplyInterval(long clusterPingReplyInterval
   }
 
   /**
-   * Get the public facing port to be used when clustering.
-   * <p>
-   * It can be configured using {@link VertxOptions#setClusterPublicHost(String)}
+   * Get the public facing host to be used when clustering.
    *
    * @return the public facing port
    */
@@ -617,8 +642,6 @@ public EventBusOptions setClusterPublicHost(String clusterPublicHost) {
 
   /**
    * Gets the public facing port to be used when clustering.
-   * <p>
-   * This can be configured from {@link VertxOptions#setClusterPublicPort(int)}.
    *
    * @return the public facing port
    */
diff --git a/src/main/java/io/vertx/core/impl/VertxFactoryImpl.java b/src/main/java/io/vertx/core/impl/VertxFactoryImpl.java
--- a/src/main/java/io/vertx/core/impl/VertxFactoryImpl.java
+++ b/src/main/java/io/vertx/core/impl/VertxFactoryImpl.java
@@ -11,11 +11,7 @@
 
 package io.vertx.core.impl;
 
-import io.vertx.core.AsyncResult;
-import io.vertx.core.Context;
-import io.vertx.core.Handler;
-import io.vertx.core.Vertx;
-import io.vertx.core.VertxOptions;
+import io.vertx.core.*;
 import io.vertx.core.spi.VertxFactory;
 
 /**
@@ -32,7 +28,7 @@ public Vertx vertx() {
 
   @Override
   public Vertx vertx(VertxOptions options) {
-    if (options.isClustered()) {
+    if (options.getEventBusOptions().isClustered()) {
       throw new IllegalArgumentException("Please use Vertx.clusteredVertx() to create a clustered Vert.x instance");
     }
     return VertxImpl.vertx(options);
@@ -41,7 +37,7 @@ public Vertx vertx(VertxOptions options) {
   @Override
   public void clusteredVertx(VertxOptions options, final Handler<AsyncResult<Vertx>> resultHandler) {
     // We don't require the user to set clustered to true if they use this method
-    options.setClustered(true);
+    options.getEventBusOptions().setClustered(true);
     VertxImpl.clusteredVertx(options, resultHandler);
   }
 
diff --git a/src/main/java/io/vertx/core/impl/VertxImpl.java b/src/main/java/io/vertx/core/impl/VertxImpl.java
--- a/src/main/java/io/vertx/core/impl/VertxImpl.java
+++ b/src/main/java/io/vertx/core/impl/VertxImpl.java
@@ -16,8 +16,8 @@
 import io.netty.resolver.AddressResolverGroup;
 import io.netty.util.ResourceLeakDetector;
 import io.netty.util.concurrent.GenericFutureListener;
-import io.vertx.core.*;
 import io.vertx.core.Future;
+import io.vertx.core.*;
 import io.vertx.core.datagram.DatagramSocket;
 import io.vertx.core.datagram.DatagramSocketOptions;
 import io.vertx.core.datagram.impl.DatagramSocketImpl;
@@ -169,7 +169,7 @@ private VertxImpl(VertxOptions options, Transport transport) {
     this.addressResolverOptions = options.getAddressResolverOptions();
     this.addressResolver = new AddressResolver(this, options.getAddressResolverOptions());
     this.deploymentManager = new DeploymentManager(this);
-    if (options.isClustered()) {
+    if (options.getEventBusOptions().isClustered()) {
       this.clusterManager = getClusterManager(options);
       this.eventBus = new ClusteredEventBus(this, options, clusterManager);
     } else {
diff --git a/src/main/java/io/vertx/core/impl/launcher/commands/BareCommand.java b/src/main/java/io/vertx/core/impl/launcher/commands/BareCommand.java
--- a/src/main/java/io/vertx/core/impl/launcher/commands/BareCommand.java
+++ b/src/main/java/io/vertx/core/impl/launcher/commands/BareCommand.java
@@ -13,6 +13,7 @@
 
 import io.vertx.core.*;
 import io.vertx.core.cli.annotations.*;
+import io.vertx.core.eventbus.EventBusOptions;
 import io.vertx.core.impl.launcher.VertxLifecycleHooks;
 import io.vertx.core.json.DecodeException;
 import io.vertx.core.json.JsonObject;
@@ -212,17 +213,18 @@ protected Vertx startVertx() {
     Vertx instance;
     if (isClustered()) {
       log.info("Starting clustering...");
-      if (!Objects.equals(options.getClusterHost(), VertxOptions.DEFAULT_CLUSTER_HOST)) {
-        clusterHost = options.getClusterHost();
+      EventBusOptions eventBusOptions = options.getEventBusOptions();
+      if (!Objects.equals(eventBusOptions.getHost(), EventBusOptions.DEFAULT_CLUSTER_HOST)) {
+        clusterHost = eventBusOptions.getHost();
       }
-      if (options.getClusterPort() != VertxOptions.DEFAULT_CLUSTER_PORT) {
-        clusterPort = options.getClusterPort();
+      if (eventBusOptions.getPort() != EventBusOptions.DEFAULT_CLUSTER_PORT) {
+        clusterPort = eventBusOptions.getPort();
       }
-      if (!Objects.equals(options.getClusterPublicHost(), VertxOptions.DEFAULT_CLUSTER_PUBLIC_HOST)) {
-        clusterPublicHost = options.getClusterPublicHost();
+      if (!Objects.equals(eventBusOptions.getClusterPublicHost(), EventBusOptions.DEFAULT_CLUSTER_PUBLIC_HOST)) {
+        clusterPublicHost = eventBusOptions.getClusterPublicHost();
       }
-      if (options.getClusterPublicPort() != VertxOptions.DEFAULT_CLUSTER_PUBLIC_PORT) {
-        clusterPublicPort = options.getClusterPublicPort();
+      if (eventBusOptions.getClusterPublicPort() != EventBusOptions.DEFAULT_CLUSTER_PUBLIC_PORT) {
+        clusterPublicPort = eventBusOptions.getClusterPublicPort();
       }
       if (clusterHost == null) {
         clusterHost = getDefaultAddress();
@@ -236,11 +238,11 @@ protected Vertx startVertx() {
       CountDownLatch latch = new CountDownLatch(1);
       AtomicReference<AsyncResult<Vertx>> result = new AtomicReference<>();
 
-      options.setClustered(true)
-        .setClusterHost(clusterHost).setClusterPort(clusterPort)
+      eventBusOptions.setClustered(true)
+        .setHost(clusterHost).setPort(clusterPort)
         .setClusterPublicHost(clusterPublicHost);
       if (clusterPublicPort != -1) {
-        options.setClusterPublicPort(clusterPublicPort);
+        eventBusOptions.setClusterPublicPort(clusterPublicPort);
       }
       if (getHA()) {
         options.setHAEnabled(true);
diff --git a/src/main/java/io/vertx/core/impl/launcher/commands/RunCommand.java b/src/main/java/io/vertx/core/impl/launcher/commands/RunCommand.java
--- a/src/main/java/io/vertx/core/impl/launcher/commands/RunCommand.java
+++ b/src/main/java/io/vertx/core/impl/launcher/commands/RunCommand.java
@@ -226,7 +226,7 @@ public void setUp(ExecutionContext context) throws CLIException {
    */
   @Override
   public boolean isClustered() {
-    return cluster || ha || (options != null  && options.isClustered());
+    return cluster || ha || (options != null && options.getEventBusOptions().isClustered());
   }
 
   @Override


Test patch:
diff --git a/src/test/java/io/vertx/core/CreateVertxTest.java b/src/test/java/io/vertx/core/CreateVertxTest.java
--- a/src/test/java/io/vertx/core/CreateVertxTest.java
+++ b/src/test/java/io/vertx/core/CreateVertxTest.java
@@ -12,10 +12,8 @@
 package io.vertx.core;
 
 import io.vertx.test.core.VertxTestBase;
-import org.junit.Test;
-
-import io.vertx.core.*;
 import io.vertx.test.fakecluster.FakeClusterManager;
+import org.junit.Test;
 
 /**
  * @author <a href="http://tfox.org">Tim Fox</a>
@@ -39,7 +37,7 @@ public void testCreateVertxWithOptions() {
   @Test
   public void testFailCreateClusteredVertxSynchronously() {
     VertxOptions options = new VertxOptions();
-    options.setClustered(true);
+    options.getEventBusOptions().setClustered(true);
     try {
       Vertx.vertx(options);
       fail("Should throw exception");
@@ -51,7 +49,7 @@ public void testFailCreateClusteredVertxSynchronously() {
   @Test
   public void testCreateClusteredVertxAsync() {
     VertxOptions options = new VertxOptions();
-    options.setClustered(true);
+    options.getEventBusOptions().setClustered(true);
     clusteredVertx(options, ar -> {
       assertTrue(ar.succeeded());
       assertNotNull(ar.result());
@@ -74,7 +72,7 @@ public void testCreateClusteredVertxAsyncDontSetClustered() {
     clusteredVertx(options, ar -> {
       assertTrue(ar.succeeded());
       assertNotNull(ar.result());
-      assertTrue(options.isClustered());
+      assertTrue(options.getEventBusOptions().isClustered());
       assertTrue(ar.result().isClustered());
       Vertx v = ar.result();
       v.close(ar2 -> {
diff --git a/src/test/java/io/vertx/core/HATest.java b/src/test/java/io/vertx/core/HATest.java
--- a/src/test/java/io/vertx/core/HATest.java
+++ b/src/test/java/io/vertx/core/HATest.java
@@ -15,10 +15,10 @@
 import io.vertx.core.impl.VertxInternal;
 import io.vertx.core.json.JsonObject;
 import io.vertx.core.spi.cluster.ClusterManager;
-import io.vertx.test.verticles.HAVerticle1;
-import io.vertx.test.verticles.HAVerticle2;
 import io.vertx.test.core.VertxTestBase;
 import io.vertx.test.fakecluster.FakeClusterManager;
+import io.vertx.test.verticles.HAVerticle1;
+import io.vertx.test.verticles.HAVerticle2;
 import org.junit.Test;
 
 import java.util.concurrent.CountDownLatch;
@@ -380,8 +380,11 @@ protected Vertx startVertx(String haGroup, int quorumSize) throws Exception {
   }
 
   protected Vertx startVertx(String haGroup, int quorumSize, boolean ha) throws Exception {
-    VertxOptions options = new VertxOptions().setHAEnabled(ha).setClustered(true).
-      setClusterHost("localhost").setClusterManager(getClusterManager());
+    VertxOptions options = new VertxOptions()
+      .setHAEnabled(ha)
+      .setClusterManager(getClusterManager());
+    options.getEventBusOptions()
+      .setClustered(true).setHost("localhost");
     if (ha) {
       options.setQuorumSize(quorumSize);
       if (haGroup != null) {
diff --git a/src/test/java/io/vertx/core/LauncherTest.java b/src/test/java/io/vertx/core/LauncherTest.java
--- a/src/test/java/io/vertx/core/LauncherTest.java
+++ b/src/test/java/io/vertx/core/LauncherTest.java
@@ -492,8 +492,8 @@ private void testConfigureFromJson(boolean jsonFile) throws Exception {
     assertEquals(123, opts.getEventLoopPoolSize(), 0);
     assertEquals(123767667L, opts.getMaxEventLoopExecuteTime());
     assertEquals(true, opts.getMetricsOptions().isEnabled());
-    assertEquals(true, opts.isClustered());
-    assertEquals("mars", opts.getClusterPublicHost());
+    assertEquals(true, opts.getEventBusOptions().isClustered());
+    assertEquals("mars", opts.getEventBusOptions().getClusterPublicHost());
     assertEquals("somegroup", opts.getHAGroup());
     assertEquals(TimeUnit.SECONDS, opts.getMaxEventLoopExecuteTimeUnit());
   }
@@ -632,10 +632,10 @@ public void testConfigureClusterHostPortFromProperties() throws Exception {
     String[] args = {"run", "java:" + TestVerticle.class.getCanonicalName(), "-cluster"};
     launcher.dispatch(args);
     assertWaitUntil(() -> TestVerticle.instanceCount.get() == 1);
-    assertEquals("127.0.0.1", launcher.options.getClusterHost());
-    assertEquals(clusterPort, launcher.options.getClusterPort());
-    assertNull(launcher.options.getClusterPublicHost());
-    assertEquals(-1, launcher.options.getClusterPublicPort());
+    assertEquals("127.0.0.1", launcher.options.getEventBusOptions().getHost());
+    assertEquals(clusterPort, launcher.options.getEventBusOptions().getPort());
+    assertNull(launcher.options.getEventBusOptions().getClusterPublicHost());
+    assertEquals(-1, launcher.options.getEventBusOptions().getClusterPublicPort());
   }
 
   @Test
@@ -645,10 +645,10 @@ public void testConfigureClusterHostPortFromCommandLine() throws Exception {
     String[] args = {"run", "java:" + TestVerticle.class.getCanonicalName(), "-cluster", "--cluster-host", "127.0.0.1", "--cluster-port", Integer.toString(clusterPort)};
     launcher.dispatch(args);
     assertWaitUntil(() -> TestVerticle.instanceCount.get() == 1);
-    assertEquals("127.0.0.1", launcher.options.getClusterHost());
-    assertEquals(clusterPort, launcher.options.getClusterPort());
-    assertNull(launcher.options.getClusterPublicHost());
-    assertEquals(-1, launcher.options.getClusterPublicPort());
+    assertEquals("127.0.0.1", launcher.options.getEventBusOptions().getHost());
+    assertEquals(clusterPort, launcher.options.getEventBusOptions().getPort());
+    assertNull(launcher.options.getEventBusOptions().getClusterPublicHost());
+    assertEquals(-1, launcher.options.getEventBusOptions().getClusterPublicPort());
   }
 
   @Test
@@ -658,8 +658,8 @@ public void testConfigureClusterPublicHostPortFromCommandLine() throws Exception
     String[] args = {"run", "java:" + TestVerticle.class.getCanonicalName(), "-cluster", "--cluster-public-host", "127.0.0.1", "--cluster-public-port", Integer.toString(clusterPublicPort)};
     launcher.dispatch(args);
     assertWaitUntil(() -> TestVerticle.instanceCount.get() == 1);
-    assertEquals("127.0.0.1", launcher.options.getClusterPublicHost());
-    assertEquals(clusterPublicPort, launcher.options.getClusterPublicPort());
+    assertEquals("127.0.0.1", launcher.options.getEventBusOptions().getClusterPublicHost());
+    assertEquals(clusterPublicPort, launcher.options.getEventBusOptions().getClusterPublicPort());
   }
 
   @Test
@@ -677,10 +677,10 @@ public void testOverrideClusterHostPortFromProperties() throws Exception {
     String[] args = {"run", "java:" + TestVerticle.class.getCanonicalName(), "-cluster"};
     launcher.dispatch(args);
     assertWaitUntil(() -> TestVerticle.instanceCount.get() == 1);
-    assertEquals("127.0.0.1", launcher.options.getClusterHost());
-    assertEquals(newClusterPort, launcher.options.getClusterPort());
-    assertEquals("127.0.0.3", launcher.options.getClusterPublicHost());
-    assertEquals(newClusterPublicPort, launcher.options.getClusterPublicPort());
+    assertEquals("127.0.0.1", launcher.options.getEventBusOptions().getHost());
+    assertEquals(newClusterPort, launcher.options.getEventBusOptions().getPort());
+    assertEquals("127.0.0.3", launcher.options.getEventBusOptions().getClusterPublicHost());
+    assertEquals(newClusterPublicPort, launcher.options.getEventBusOptions().getClusterPublicPort());
   }
 
   @Test
@@ -702,10 +702,10 @@ public void testOverrideClusterHostPortFromCommandLine() throws Exception {
     };
     launcher.dispatch(args);
     assertWaitUntil(() -> TestVerticle.instanceCount.get() == 1);
-    assertEquals("127.0.0.1", launcher.options.getClusterHost());
-    assertEquals(newClusterPort, launcher.options.getClusterPort());
-    assertEquals("127.0.0.3", launcher.options.getClusterPublicHost());
-    assertEquals(newClusterPublicPort, launcher.options.getClusterPublicPort());
+    assertEquals("127.0.0.1", launcher.options.getEventBusOptions().getHost());
+    assertEquals(newClusterPort, launcher.options.getEventBusOptions().getPort());
+    assertEquals("127.0.0.3", launcher.options.getEventBusOptions().getClusterPublicHost());
+    assertEquals(newClusterPublicPort, launcher.options.getEventBusOptions().getClusterPublicPort());
   }
 
   class MyLauncher extends Launcher {
@@ -751,10 +751,11 @@ public void beforeStartingVertx(VertxOptions options) {
       beforeStartingVertxInvoked = true;
       this.options = options;
       if (clusterHost != null) {
-        options.setClusterHost(clusterHost);
-        options.setClusterPort(clusterPort);
-        options.setClusterPublicHost(clusterPublicHost);
-        options.setClusterPublicPort(clusterPublicPort);
+        options.getEventBusOptions()
+          .setHost(clusterHost)
+          .setPort(clusterPort)
+          .setClusterPublicHost(clusterPublicHost)
+          .setClusterPublicPort(clusterPublicPort);
         super.beforeStartingVertx(options);
       }
     }
diff --git a/src/test/java/io/vertx/core/VertxOptionsTest.java b/src/test/java/io/vertx/core/VertxOptionsTest.java
--- a/src/test/java/io/vertx/core/VertxOptionsTest.java
+++ b/src/test/java/io/vertx/core/VertxOptionsTest.java
@@ -61,66 +61,66 @@ public void testOptions() {
     } catch (IllegalArgumentException e) {
       // OK
     }
-    assertFalse(options.isClustered());
-    assertEquals(options, options.setClustered(true));
-    assertTrue(options.isClustered());
-    assertEquals(0, options.getClusterPort());
-    assertEquals(options, options.setClusterPort(1234));
-    assertEquals(1234, options.getClusterPort());
+    assertFalse(options.getEventBusOptions().isClustered());
+    options.getEventBusOptions().setClustered(true);
+    assertTrue(options.getEventBusOptions().isClustered());
+    assertEquals(0, options.getEventBusOptions().getPort());
+    options.getEventBusOptions().setPort(1234);
+    assertEquals(1234, options.getEventBusOptions().getPort());
     try {
-      options.setClusterPort(-1);
+      options.getEventBusOptions().setPort(-1);
       fail("Should throw exception");
     } catch (IllegalArgumentException e) {
       // OK
     }
     try {
-      options.setClusterPort(65536);
+      options.getEventBusOptions().setPort(65536);
       fail("Should throw exception");
     } catch (IllegalArgumentException e) {
       // OK
     }
-    assertEquals(-1, options.getClusterPublicPort());
-    assertEquals(options, options.setClusterPublicPort(1234));
-    assertEquals(1234, options.getClusterPublicPort());
+    assertEquals(-1, options.getEventBusOptions().getClusterPublicPort());
+    options.getEventBusOptions().setClusterPublicPort(1234);
+    assertEquals(1234, options.getEventBusOptions().getClusterPublicPort());
     try {
-      options.setClusterPublicPort(-1);
+      options.getEventBusOptions().setClusterPublicPort(-1);
       fail("Should throw exception");
     } catch (IllegalArgumentException e) {
       // OK
     }
     try {
-      options.setClusterPublicPort(65536);
+      options.getEventBusOptions().setClusterPublicPort(65536);
       fail("Should throw exception");
     } catch (IllegalArgumentException e) {
       // OK
     }
-    assertEquals("localhost", options.getClusterHost());
+    assertEquals("localhost", options.getEventBusOptions().getHost());
     String randString = TestUtils.randomUnicodeString(100);
-    assertEquals(options, options.setClusterHost(randString));
-    assertEquals(randString, options.getClusterHost());
-    assertEquals(null, options.getClusterPublicHost());
+    options.getEventBusOptions().setHost(randString);
+    assertEquals(randString, options.getEventBusOptions().getHost());
+    assertEquals(null, options.getEventBusOptions().getClusterPublicHost());
     randString = TestUtils.randomUnicodeString(100);
-    assertEquals(options, options.setClusterPublicHost(randString));
-    assertEquals(randString, options.getClusterPublicHost());
-    assertEquals(20000, options.getClusterPingInterval());
+    options.getEventBusOptions().setClusterPublicHost(randString);
+    assertEquals(randString, options.getEventBusOptions().getClusterPublicHost());
+    assertEquals(20000, options.getEventBusOptions().getClusterPingInterval());
     long randomLong = TestUtils.randomPositiveLong();
-    assertEquals(options, options.setClusterPingInterval(randomLong));
-    assertEquals(randomLong, options.getClusterPingInterval());
+    options.getEventBusOptions().setClusterPingInterval(randomLong);
+    assertEquals(randomLong, options.getEventBusOptions().getClusterPingInterval());
     try {
-      options.setClusterPingInterval(-1);
+      options.getEventBusOptions().setClusterPingInterval(-1);
       fail("Should throw exception");
     } catch (IllegalArgumentException e) {
-      assertEquals(randomLong, options.getClusterPingInterval());
+      assertEquals(randomLong, options.getEventBusOptions().getClusterPingInterval());
     }
-    assertEquals(20000, options.getClusterPingReplyInterval());
+    assertEquals(20000, options.getEventBusOptions().getClusterPingReplyInterval());
     randomLong = TestUtils.randomPositiveLong();
-    assertEquals(options, options.setClusterPingReplyInterval(randomLong));
-    assertEquals(randomLong, options.getClusterPingReplyInterval());
+    options.getEventBusOptions().setClusterPingReplyInterval(randomLong);
+    assertEquals(randomLong, options.getEventBusOptions().getClusterPingReplyInterval());
     try {
-      options.setClusterPingReplyInterval(-1);
+      options.getEventBusOptions().setClusterPingReplyInterval(-1);
       fail("Should throw exception");
     } catch (IllegalArgumentException e) {
-      assertEquals(randomLong, options.getClusterPingReplyInterval());
+      assertEquals(randomLong, options.getEventBusOptions().getClusterPingReplyInterval());
     }
     assertEquals(1000, options.getBlockedThreadCheckInterval());
     rand = TestUtils.randomPositiveInt();
@@ -234,16 +234,16 @@ public void testCopyOptions() {
     TimeUnit maxWorkerExecuteTimeUnit = TimeUnit.MILLISECONDS;
     TimeUnit warningExceptionTimeUnit = TimeUnit.MINUTES;
     TimeUnit blockedThreadCheckIntervalUnit = TimeUnit.MINUTES;
-    options.setClusterPort(clusterPort);
-    options.setClusterPublicPort(clusterPublicPort);
+    options.getEventBusOptions().setPort(clusterPort);
+    options.getEventBusOptions().setClusterPublicPort(clusterPublicPort);
     options.setEventLoopPoolSize(eventLoopPoolSize);
     options.setInternalBlockingPoolSize(internalBlockingPoolSize);
     options.setWorkerPoolSize(workerPoolSize);
     options.setBlockedThreadCheckInterval(blockedThreadCheckInterval);
-    options.setClusterHost(clusterHost);
-    options.setClusterPublicHost(clusterPublicHost);
-    options.setClusterPingInterval(clusterPingInterval);
-    options.setClusterPingReplyInterval(clusterPingReplyInterval);
+    options.getEventBusOptions().setHost(clusterHost);
+    options.getEventBusOptions().setClusterPublicHost(clusterPublicHost);
+    options.getEventBusOptions().setClusterPingInterval(clusterPingInterval);
+    options.getEventBusOptions().setClusterPingReplyInterval(clusterPingReplyInterval);
     options.setMaxEventLoopExecuteTime(maxEventLoopExecuteTime);
     options.setMaxWorkerExecuteTime(maxWorkerExecuteTime);
     options.setHAEnabled(haEnabled);
@@ -260,16 +260,16 @@ public void testCopyOptions() {
     options.setBlockedThreadCheckIntervalUnit(blockedThreadCheckIntervalUnit);
 
     options = new VertxOptions(options);
-    assertEquals(clusterPort, options.getClusterPort());
-    assertEquals(clusterPublicPort, options.getClusterPublicPort());
-    assertEquals(clusterPingInterval, options.getClusterPingInterval());
-    assertEquals(clusterPingReplyInterval, options.getClusterPingReplyInterval());
+    assertEquals(clusterPort, options.getEventBusOptions().getPort());
+    assertEquals(clusterPublicPort, options.getEventBusOptions().getClusterPublicPort());
+    assertEquals(clusterPingInterval, options.getEventBusOptions().getClusterPingInterval());
+    assertEquals(clusterPingReplyInterval, options.getEventBusOptions().getClusterPingReplyInterval());
     assertEquals(eventLoopPoolSize, options.getEventLoopPoolSize());
     assertEquals(internalBlockingPoolSize, options.getInternalBlockingPoolSize());
     assertEquals(workerPoolSize, options.getWorkerPoolSize());
     assertEquals(blockedThreadCheckInterval, options.getBlockedThreadCheckInterval());
-    assertEquals(clusterHost, options.getClusterHost());
-    assertEquals(clusterPublicHost, options.getClusterPublicHost());
+    assertEquals(clusterHost, options.getEventBusOptions().getHost());
+    assertEquals(clusterPublicHost, options.getEventBusOptions().getClusterPublicHost());
     assertEquals(maxEventLoopExecuteTime, options.getMaxEventLoopExecuteTime());
     assertEquals(maxWorkerExecuteTime, options.getMaxWorkerExecuteTime());
     assertEquals(haEnabled, options.isHAEnabled());
@@ -292,12 +292,12 @@ public void testDefaultJsonOptions() {
     VertxOptions json = new VertxOptions(new JsonObject());
     assertEquals(def.getEventLoopPoolSize(), json.getEventLoopPoolSize());
     assertEquals(def.getWorkerPoolSize(), json.getWorkerPoolSize());
-    assertEquals(def.isClustered(), json.isClustered());
-    assertEquals(def.getClusterHost(), json.getClusterHost());
-    assertEquals(def.getClusterPublicHost(), json.getClusterPublicHost());
-    assertEquals(def.getClusterPublicPort(), json.getClusterPublicPort());
-    assertEquals(def.getClusterPingInterval(), json.getClusterPingInterval());
-    assertEquals(def.getClusterPingReplyInterval(), json.getClusterPingReplyInterval());
+    assertEquals(def.getEventBusOptions().isClustered(), json.getEventBusOptions().isClustered());
+    assertEquals(def.getEventBusOptions().getHost(), json.getEventBusOptions().getHost());
+    assertEquals(def.getEventBusOptions().getClusterPublicHost(), json.getEventBusOptions().getClusterPublicHost());
+    assertEquals(def.getEventBusOptions().getClusterPublicPort(), json.getEventBusOptions().getClusterPublicPort());
+    assertEquals(def.getEventBusOptions().getClusterPingInterval(), json.getEventBusOptions().getClusterPingInterval());
+    assertEquals(def.getEventBusOptions().getClusterPingReplyInterval(), json.getEventBusOptions().getClusterPingReplyInterval());
     assertEquals(def.getBlockedThreadCheckInterval(), json.getBlockedThreadCheckInterval());
     assertEquals(def.getMaxEventLoopExecuteTime(), json.getMaxEventLoopExecuteTime());
     assertEquals(def.getMaxWorkerExecuteTime(), json.getMaxWorkerExecuteTime());
@@ -317,16 +317,16 @@ public void testDefaultJsonOptions() {
   public void testJsonOptions() {
     VertxOptions options = new VertxOptions(new JsonObject());
 
-    assertEquals(0, options.getClusterPort());
-    assertEquals(-1, options.getClusterPublicPort());
-    assertEquals(20000, options.getClusterPingInterval());
-    assertEquals(20000, options.getClusterPingReplyInterval());
+    assertEquals(0, options.getEventBusOptions().getPort());
+    assertEquals(-1, options.getEventBusOptions().getClusterPublicPort());
+    assertEquals(20000, options.getEventBusOptions().getClusterPingInterval());
+    assertEquals(20000, options.getEventBusOptions().getClusterPingReplyInterval());
     assertEquals(2 * Runtime.getRuntime().availableProcessors(), options.getEventLoopPoolSize());
     assertEquals(20, options.getInternalBlockingPoolSize());
     assertEquals(20, options.getWorkerPoolSize());
     assertEquals(1000, options.getBlockedThreadCheckInterval());
-    assertEquals("localhost", options.getClusterHost());
-    assertNull(options.getClusterPublicHost());
+    assertEquals("localhost", options.getEventBusOptions().getHost());
+    assertNull(options.getEventBusOptions().getClusterPublicHost());
     assertEquals(null, options.getClusterManager());
     assertEquals(2000l * 1000000, options.getMaxEventLoopExecuteTime());
     assertEquals(1l * 60 * 1000 * 1000000, options.getMaxWorkerExecuteTime());
@@ -397,16 +397,16 @@ public void testJsonOptions() {
         put("warningExceptionTimeUnit", warningExceptionTimeUnit).
         put("blockedThreadCheckIntervalUnit", blockedThreadCheckIntervalUnit)
     );
-    assertEquals(clusterPort, options.getClusterPort());
-    assertEquals(clusterPublicPort, options.getClusterPublicPort());
-    assertEquals(clusterPublicHost, options.getClusterPublicHost());
-    assertEquals(clusterPingInterval, options.getClusterPingInterval());
-    assertEquals(clusterPingReplyInterval, options.getClusterPingReplyInterval());
+    assertEquals(clusterPort, options.getEventBusOptions().getPort());
+    assertEquals(clusterPublicPort, options.getEventBusOptions().getClusterPublicPort());
+    assertEquals(clusterPublicHost, options.getEventBusOptions().getClusterPublicHost());
+    assertEquals(clusterPingInterval, options.getEventBusOptions().getClusterPingInterval());
+    assertEquals(clusterPingReplyInterval, options.getEventBusOptions().getClusterPingReplyInterval());
     assertEquals(eventLoopPoolSize, options.getEventLoopPoolSize());
     assertEquals(internalBlockingPoolSize, options.getInternalBlockingPoolSize());
     assertEquals(workerPoolSize, options.getWorkerPoolSize());
     assertEquals(blockedThreadCheckInterval, options.getBlockedThreadCheckInterval());
-    assertEquals(clusterHost, options.getClusterHost());
+    assertEquals(clusterHost, options.getEventBusOptions().getHost());
     assertEquals(null, options.getClusterManager());
     assertEquals(maxEventLoopExecuteTime, options.getMaxEventLoopExecuteTime());
     assertEquals(maxWorkerExecuteTime, options.getMaxWorkerExecuteTime());
diff --git a/src/test/java/io/vertx/core/eventbus/ClusteredEventBusStartFailureTest.java b/src/test/java/io/vertx/core/eventbus/ClusteredEventBusStartFailureTest.java
--- a/src/test/java/io/vertx/core/eventbus/ClusteredEventBusStartFailureTest.java
+++ b/src/test/java/io/vertx/core/eventbus/ClusteredEventBusStartFailureTest.java
@@ -34,8 +34,8 @@ public void testCallbackInvokedOnFailure() throws Exception {
     String hostName = "zoom.zoom.zen.tld";
 
     VertxOptions options = new VertxOptions()
-      .setClusterManager(new FakeClusterManager())
-      .setClusterHost(hostName);
+      .setClusterManager(new FakeClusterManager());
+    options.getEventBusOptions().setHost(hostName);
 
     AtomicReference<AsyncResult<Vertx>> resultRef = new AtomicReference<>();
 
diff --git a/src/test/java/io/vertx/core/eventbus/ClusteredEventBusTest.java b/src/test/java/io/vertx/core/eventbus/ClusteredEventBusTest.java
--- a/src/test/java/io/vertx/core/eventbus/ClusteredEventBusTest.java
+++ b/src/test/java/io/vertx/core/eventbus/ClusteredEventBusTest.java
@@ -147,7 +147,9 @@ public void testDefaultCodecReplyExceptionSubclass() throws Exception {
   // Make sure ping/pong works ok
   @Test
   public void testClusteredPong() throws Exception {
-    startNodes(2, new VertxOptions().setClusterPingInterval(500).setClusterPingReplyInterval(500));
+    VertxOptions options = new VertxOptions();
+    options.getEventBusOptions().setClusterPingInterval(500).setClusterPingReplyInterval(500);
+    startNodes(2, options);
     AtomicBoolean sending = new AtomicBoolean();
     MessageConsumer<String> consumer = vertices[0].eventBus().<String>consumer("foobar").handler(msg -> {
       if (!sending.get()) {
diff --git a/src/test/java/io/vertx/core/impl/launcher/LauncherExtensibilityTest.java b/src/test/java/io/vertx/core/impl/launcher/LauncherExtensibilityTest.java
--- a/src/test/java/io/vertx/core/impl/launcher/LauncherExtensibilityTest.java
+++ b/src/test/java/io/vertx/core/impl/launcher/LauncherExtensibilityTest.java
@@ -125,7 +125,7 @@ public void afterStartingVertx(Vertx vertx) {
 
       @Override
       public void beforeStartingVertx(VertxOptions options) {
-        options.setClustered(true);
+        options.getEventBusOptions().setClustered(true);
       }
 
       @Override
diff --git a/src/test/java/io/vertx/core/spi/metrics/MetricsContextTest.java b/src/test/java/io/vertx/core/spi/metrics/MetricsContextTest.java
--- a/src/test/java/io/vertx/core/spi/metrics/MetricsContextTest.java
+++ b/src/test/java/io/vertx/core/spi/metrics/MetricsContextTest.java
@@ -11,41 +11,18 @@
 
 package io.vertx.core.spi.metrics;
 
-import io.vertx.core.AbstractVerticle;
-import io.vertx.core.Context;
-import io.vertx.core.DeploymentOptions;
-import io.vertx.core.Handler;
-import io.vertx.core.Verticle;
-import io.vertx.core.Vertx;
-import io.vertx.core.VertxOptions;
+import io.vertx.core.*;
 import io.vertx.core.buffer.Buffer;
 import io.vertx.core.datagram.DatagramSocket;
 import io.vertx.core.datagram.DatagramSocketOptions;
 import io.vertx.core.eventbus.EventBus;
+import io.vertx.core.eventbus.EventBusOptions;
 import io.vertx.core.eventbus.MessageConsumer;
-import io.vertx.core.http.HttpClient;
-import io.vertx.core.http.HttpClientOptions;
-import io.vertx.core.http.HttpClientRequest;
-import io.vertx.core.http.HttpClientResponse;
-import io.vertx.core.http.HttpServer;
-import io.vertx.core.http.HttpServerOptions;
-import io.vertx.core.http.HttpServerRequest;
-import io.vertx.core.http.HttpServerResponse;
-import io.vertx.core.http.ServerWebSocket;
-import io.vertx.core.http.WebSocket;
+import io.vertx.core.http.*;
 import io.vertx.core.metrics.MetricsOptions;
 import io.vertx.core.metrics.impl.DummyVertxMetrics;
-import io.vertx.core.net.NetClient;
-import io.vertx.core.net.NetClientOptions;
-import io.vertx.core.net.NetServer;
-import io.vertx.core.net.NetServerOptions;
-import io.vertx.core.net.SocketAddress;
+import io.vertx.core.net.*;
 import io.vertx.core.spi.VertxMetricsFactory;
-import io.vertx.core.spi.metrics.DatagramSocketMetrics;
-import io.vertx.core.spi.metrics.EventBusMetrics;
-import io.vertx.core.spi.metrics.HttpClientMetrics;
-import io.vertx.core.spi.metrics.HttpServerMetrics;
-import io.vertx.core.spi.metrics.TCPMetrics;
 import io.vertx.test.core.VertxTestBase;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -85,7 +62,10 @@ public void testFactoryInCluster() throws Exception {
       metricsContext.set(Vertx.currentContext());
       return DummyVertxMetrics.INSTANCE;
     };
-    clusteredVertx(new VertxOptions().setClustered(true).setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(factory)), onSuccess(vertx -> {
+    VertxOptions options = new VertxOptions()
+      .setMetricsOptions(new MetricsOptions().setEnabled(true).setFactory(factory))
+      .setEventBusOptions(new EventBusOptions().setClustered(true));
+    clusteredVertx(options, onSuccess(vertx -> {
       assertSame(testThread, metricsThread.get());
       assertNull(metricsContext.get());
       testComplete();
diff --git a/src/test/java/io/vertx/test/core/VertxTestBase.java b/src/test/java/io/vertx/test/core/VertxTestBase.java
--- a/src/test/java/io/vertx/test/core/VertxTestBase.java
+++ b/src/test/java/io/vertx/test/core/VertxTestBase.java
@@ -11,26 +11,15 @@
 
 package io.vertx.test.core;
 
-import io.vertx.core.AbstractVerticle;
-import io.vertx.core.AsyncResult;
-import io.vertx.core.Context;
-import io.vertx.core.DeploymentOptions;
-import io.vertx.core.Handler;
-import io.vertx.core.Vertx;
-import io.vertx.core.VertxOptions;
+import io.vertx.core.*;
 import io.vertx.core.logging.Logger;
 import io.vertx.core.logging.LoggerFactory;
-import io.vertx.core.net.JksOptions;
-import io.vertx.core.net.KeyCertOptions;
-import io.vertx.core.net.PemKeyCertOptions;
-import io.vertx.core.net.PfxOptions;
-import io.vertx.core.net.TCPSSLOptions;
+import io.vertx.core.net.*;
 import io.vertx.core.spi.cluster.ClusterManager;
 import io.vertx.test.fakecluster.FakeClusterManager;
 import org.junit.Rule;
 
 import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocketFactory;
 import java.security.NoSuchAlgorithmException;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -156,8 +145,9 @@ protected void startNodes(int numNodes, VertxOptions options) {
     vertices = new Vertx[numNodes];
     for (int i = 0; i < numNodes; i++) {
       int index = i;
-      clusteredVertx(options.setClusterHost("localhost").setClusterPort(0).setClustered(true)
-        .setClusterManager(getClusterManager()), ar -> {
+      options.setClusterManager(getClusterManager())
+        .getEventBusOptions().setHost("localhost").setPort(0).setClustered(true);
+      clusteredVertx(options, ar -> {
           try {
             if (ar.failed()) {
               ar.cause().printStackTrace();