io.vertx.core

## Interface VertxBuilder

-     public interface VertxBuilder

  A builder for creating Vert.x instances, allowing to configure Vert.x plugins:
  - metrics
  - tracing
  - cluster manager
  Example usage:

         Vertx vertx = Vertx.builder().with(options).withMetrics(metricsFactory).build();

  Author:
    Julien Viet

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `Vertx` | `build()` Creates a non clustered instance.
    `Future<Vertx>` | `buildClustered()` Creates a clustered instance.
    `default void` | `buildClustered(Handler<AsyncResult<Vertx>> handler)` Creates a clustered instance.
    `VertxBuilder` | `with(VertxOptions options)` Configure the Vert.x options.
    `VertxBuilder` | `withClusterManager(ClusterManager clusterManager)` Programmatically set the cluster manager to be used when clustering.
    `VertxBuilder` | `withMetrics(VertxMetricsFactory factory)` Programmatically set the metrics factory to be used when metrics are enabled.
    `VertxBuilder` | `withTracer(VertxTracerFactory factory)` Programmatically set the tracer factory to be used when tracing are enabled.

- - ### Method Detail

    - #### with

          VertxBuilder with(VertxOptions options)

      Configure the Vert.x options.
      Parameters:
        `options` - the Vert.x options
      Returns:
        a reference to this, so the API can be used fluently

    - #### withMetrics

          VertxBuilder withMetrics(VertxMetricsFactory factory)

      Programmatically set the metrics factory to be used when metrics are enabled.

      Only valid if `MetricsOptions.isEnabled()` = true.

      Normally Vert.x will look on the classpath for a metrics factory implementation, but if you want to set one programmatically you can use this method.

      Parameters:
        `factory` - the metrics factory
      Returns:
        a reference to this, so the API can be used fluently

    - #### withTracer

          VertxBuilder withTracer(VertxTracerFactory factory)

      Programmatically set the tracer factory to be used when tracing are enabled.

      Normally Vert.x will look on the classpath for a tracer factory implementation, but if you want to set one programmatically you can use this method.

      Parameters:
        `factory` - the tracer factory
      Returns:
        a reference to this, so the API can be used fluently

    - #### withClusterManager

          VertxBuilder withClusterManager(ClusterManager clusterManager)

      Programmatically set the cluster manager to be used when clustering.

      Only valid if clustered = true.

      Normally Vert.x will look on the classpath for a cluster manager, but if you want to set one programmatically you can use this method.

      Parameters:
        `clusterManager` - the cluster manager
      Returns:
        a reference to this, so the API can be used fluently

    - #### build

          Vertx build()

      Creates a non clustered instance.
      Returns:
        the instance

    - #### buildClustered

          Future<Vertx> buildClustered()

      Creates a clustered instance.

      The instance is created asynchronously and the returned future is completed with the result when it is ready.

      Returns:
        a future completed with the clustered vertx

    - #### buildClustered

          default void buildClustered(Handler<AsyncResult<Vertx>> handler)

      Creates a clustered instance.

      The instance is created asynchronously and the returned future is completed with the result when it is ready.

Copyright © 2024 Eclipse. All rights reserved.