Example usage for io.vertx.core VertxOptions setAddressResolverOptions

List of usage examples for io.vertx.core VertxOptions setAddressResolverOptions

Introduction

In this page you can find the example usage for io.vertx.core VertxOptions setAddressResolverOptions.

Prototype

public VertxOptions setAddressResolverOptions(AddressResolverOptions addressResolverOptions) 

Source Link

Document

Sets the address resolver configuration to configure resolving DNS servers, cache TTL, etc...

Usage

From source file:me.bayes.vertx.spring.boot.VertxAutoConfiguration.java

License:Apache License

@Bean
public VertxOptions vertxOptions(final VertxProperties properties,
        final AddressResolverOptions addressResolverOptions) {

    final String propertyJson = Json.encode(properties);
    LOG.info("Loaded vertx properties '{}'.", propertyJson);

    final JsonObject config = new JsonObject(propertyJson);

    final VertxOptions options = new VertxOptions(config);
    options.setAddressResolverOptions(addressResolverOptions);

    return options;
}

From source file:org.apache.servicecomb.config.client.ConfigCenterClient.java

License:Apache License

private void deployConfigClient() throws InterruptedException {
    VertxOptions vertxOptions = new VertxOptions();
    vertxOptions.setAddressResolverOptions(AddressResolverConfig.getAddressResover(SSL_KEY,
            ConfigCenterConfig.INSTANCE.getConcurrentCompositeConfiguration()));
    Vertx vertx = VertxUtils.getOrCreateVertxByName("config-center", vertxOptions);

    HttpClientOptions httpClientOptions = createHttpClientOptions();
    clientMgr = new ClientPoolManager<>(vertx, new HttpClientPoolFactory(httpClientOptions));

    DeploymentOptions deployOptions = VertxUtils.createClientDeployOptions(clientMgr, 1);
    VertxUtils.blockDeploy(vertx, ClientVerticle.class, deployOptions);
}

From source file:org.apache.servicecomb.serviceregistry.client.http.AbstractClientPool.java

License:Apache License

public void create() {
    // ??????vertx
    VertxOptions vertxOptions = new VertxOptions();
    vertxOptions.setAddressResolverOptions(AddressResolverConfig.getAddressResover(SSL_KEY));
    Vertx vertx = VertxUtils.getOrCreateVertxByName("registry", vertxOptions);
    HttpClientOptions httpClientOptions = createHttpClientOptions();
    clientMgr = new ClientPoolManager<>(vertx, new HttpClientPoolFactory(httpClientOptions));

    DeploymentOptions deployOptions = VertxUtils.createClientDeployOptions(this.clientMgr,
            ServiceRegistryConfig.INSTANCE.getWorkerPoolSize());
    try {//from   w  w w.  j ava  2s . c om
        VertxUtils.blockDeploy(vertx, ClientVerticle.class, deployOptions);
    } catch (InterruptedException e) {
        LOGGER.error("deploy a registry verticle failed, {}", e.getMessage());
    }
}